Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close menu when Link to is clicked. #43

Closed
benjaminthedev opened this issue Aug 9, 2021 · 1 comment
Closed

Close menu when Link to is clicked. #43

benjaminthedev opened this issue Aug 9, 2021 · 1 comment

Comments

@benjaminthedev
Copy link

Hi folks,

This is a great library so thank you! I have a question when a user toggles open the menu and clicks a Link to - is that a way to have the menu close again. Here is my code:

Screenshot 2021-08-09 at 13 24 52

I have tried to use:

toggled={isOpen} toggle={setOpen}

On the menu anchor tag and list item tag too. What am I doing wrong here?

Thank you,

Ben.

@luukdv
Copy link
Collaborator

luukdv commented Aug 9, 2021

Hi! 👋

Thanks. You can do the following:

<Link onClick={() => setOpen(false)} to="/">Home</Link>

@luukdv luukdv closed this as completed Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants