🧳

useHistory and useParams

useParams is use to get the parameter passing in the url
For This time being i am creating a route to open my post as a page on clicking a button
notion image
So for This i have created a page (route) called Post.js inside the route folder then
notion image
Beacause of a parameter it has to same on both page (id )——>name should be same
notion image
Then you can either use the useHistory to redirect on a page or simply i give a link to the button
notion image
notion image
💡
Use History hook can be used like this :
notion image
💡
It is an object having a property called push so we cann just use history.push( url )