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
So for This i have created a page (route) called Post.js inside the route folder then
Beacause of a parameter it has to same on both page (id )——>name should be same
Then you can either use the useHistory to redirect on a page or simply i give a link to the button
Use History hook can be used like this :
It is an object having a property called push so we cann just use history.push( url )