Dispatch action if path changes
Unanswered
Sloth bear posted this in #help-forum
Sloth bearOP
All I want to do is detect whether a path change is happening and dispatch an action based on that. I'm using the app router obviously, so no router.events...
I tried useEffect + usePathname but useEffect never sees the eventual destination route until, I presume, the encapsulating component is removed from the DOM.
I tried useEffect + usePathname but useEffect never sees the eventual destination route until, I presume, the encapsulating component is removed from the DOM.