Skip to content

Expose header navigation open/close state (with setter) #52

@charlesomer

Description

@charlesomer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions