Page change, but on the same route #240
-
Hi 👋 Let's imagine a fictitious simplified routing such as : When I click on the link, it changes the url but it doesn't reload the content of the page since (for the router) we are still on the same page 😬 How can I fix this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The Instead do this... function Chapter(props) {
const params = useParams();
return (
<>
<p>{params.slug + " : " + params.page}</p>
--- |
Beta Was this translation helpful? Give feedback.
-
thank you for your answer 💖 edit : in fact, I oversimplified the problem was with But maybe I'm doing something wrong and breaking the reactivity? In any case, I moved the logic in my component and I removed |
Beta Was this translation helpful? Give feedback.
The
Chapter
function only runs once. So you can't destructure the params at the top.Instead do this...