How to log all url changes? #10676
-
For debug purpose, I'd like to log current path and redirecting path when url changes. For example:
How to implement this? |
Beta Was this translation helpful? Give feedback.
Answered by
brophdawg11
Jul 7, 2023
Replies: 1 comment
-
The simplest way is to setup a If you want more advanced logic, if you're using a |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Toshinaki
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The simplest way is to setup a
useEffect
in your root component based onuseLocation
but that can only log each new location.If you want more advanced logic, if you're using a
RouterProvider
you can get more information if you leverageuseNavigation
as well to log in-flight navigations.