Run logic when whenever location changes but not on mount. #11373
Unanswered
antonisprovidakis
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a correct/recommended (i.e. not hacky) way to run some logic when pathname changes but not on first run?
I mean, code below runs when component/hook first mounts and every time pathname changes:
I don't want the code to run when component mounts, as this is not actually a location change.
Beta Was this translation helpful? Give feedback.
All reactions