DEV Community

Discussion on: Dynamic Pages using React Router

Collapse
 
richardrobberse profile image
Richard Robberse

Small optimization: you could use the useParams() hook to get the params instead of using props.match.params.

Collapse
 
supunkavinda profile image
Supun Kavinda

You said what I was going to say ;)

Collapse
 
aissa0347 profile image
Aissa0347

I tried to use useParams() and it works fine but when i refresh the page all the content dispear