Skip to content

How to log all url changes? #10676

Closed Answered by brophdawg11
Toshinaki asked this question in Q&A
Discussion options

You must be logged in to vote

The simplest way is to setup a useEffect in your root component based on useLocation 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 leverage useNavigation as well to log in-flight navigations.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Toshinaki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants