Best way to reset a state when moving between dynamic pages?
Unanswered
Cuckoo wasp posted this in #help-forum
Cuckoo waspOP
So, I have a header which has a state that gets changed when someone clicks on a menu. Based on the state (true/false), a hidden div is made visible. But if I move between pages, the state persists because of which the div doesn't go invisible. How to reset it? I read using useEffects dependent on usePathname() could do the trick. Is this the best way to do this?