I'm not sure if I'm missing something obvious here (if I am, please point it out), I've been trying to close the menu (if it's open) if the route changes within my app. Since the HeaderContext provider doesn't cover my own components, I seem only to be able to access the menuOpen property and not use toggleMenu or setMenuToggle.
I believe this is a limitation of the context api in general - not being able to set a context that's not provided (although it seems odd to me that I can view things like menuOpen still).
Am I missing an obvious prop I can use/set with the header component that allows me to set the menuOpen state? If not, what would be the best way to achieve this currently?
Thank you
Charles
I'm not sure if I'm missing something obvious here (if I am, please point it out), I've been trying to close the menu (if it's open) if the route changes within my app. Since the
HeaderContextprovider doesn't cover my own components, I seem only to be able to access themenuOpenproperty and not usetoggleMenuorsetMenuToggle.I believe this is a limitation of the context api in general - not being able to set a context that's not provided (although it seems odd to me that I can view things like
menuOpenstill).Am I missing an obvious prop I can use/set with the header component that allows me to set the
menuOpenstate? If not, what would be the best way to achieve this currently?Thank you
Charles