Is there any event available for navigation url start and navigation url complete #13440
Unanswered
gopal-freshwork
asked this question in
Q&A
Replies: 2 comments
-
Please refer to the link below |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can use the useNavigation hook to know when a navigation is happening. Pair them with useEffect and you can react to them changing. e.g. let location = useLocation()
useEffect(() => {
analytics.pageview(location)
}, [location]) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Team,
we are working on a requirement where we need to log the event before navigation start and after navigation complete for our analytics purpose.
In nextjs, we have Router events, and they are providing
routeChangeStart
androuteChangeComplete
.In React router 7, do we have anything similar to that or any other alternative way is there to implement that behaviour?
Thanks in Advance
Beta Was this translation helpful? Give feedback.
All reactions