useNavigationEvent to react to user intentions #11397
stevecrozz
started this conversation in
Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It is already possible to work around the lack of navigation events for the case when we are interested in location changes using useEffect+useLocation. But when we are interested in all navigation events, including navigations that do not change the location, we don't have any good tools.
I would like to see a new useNavigationEvent hook to observe navigation events of all kinds. Any calls to navigator.push or navigator.replace should trigger an event. This way a user could click on a nav link and we could monitor that event in order to respond even when that event does not trigger an actual route change.
Beta Was this translation helpful? Give feedback.
All reactions