Topic: React - SideNav - How to close SideNav after selecting an SideNavLink
Hi Supporter,
I am using SideNav with react - I would like to close the SideNav after user select a SideNavLink or SideNavItem, How should I do that. I could not find a way to do it so far.
Thanks,
Long Cao
Add comment
Jakub Strebeyko staff answered 7 years ago
Hi Long Cao,
Welcome to the Support Board! Whether SideNav is open depends on the
isOpen
prop it receives (from this.state
or elsewhere). The easiest thing to do would be to attach a click event listener to SideNavLinks with a callback to a function that causes the change of the prop (say, a this.setState
kind of change).
Hope you find this information useful.
With Best Regards,
Kuba FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Answered
Specification of the issue
- User: Pro
- Premium support: No
- Technology: MDB React
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No