How to listen for the route change? #4240
-
Some time ago I used preact + preact-router and my app page components were wrapped in a Now I used So my question is how do I start listening to the route updates with this setup? Is there a preact/vike/vite hook for this? |
Beta Was this translation helpful? Give feedback.
Answered by
orangecoloured
Dec 23, 2023
Replies: 1 comment
-
I think I found a way to listen to route change. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
orangecoloured
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think I found a way to listen to route change.
useEffect
onpageContext.urlPathname
in the main component does the job. At least for now it's enough.