Topic: Dropdown in Navbar not compatible with React Router
Julien “Err0r404” Schmitt asked 7 years ago
Jakub Mandra staff premium answered 7 years ago
Hello Julien,
You have got to nest <DropdownItem> into <NavLink> if you want a dropdown item to act as a Router link.
Here is example code:
<Dropdown> <DropdownToggle caret color="primary"> Material dropdown </DropdownToggle> <DropdownMenu> <NavLink to="/link_to_somewhere"> <DropdownItem>Link</DropdownItem> </NavLink> </DropdownMenu> </Dropdown>
Best regards,
Jakub from MDB
Julien “Err0r404” Schmitt answered 6 years ago
Thanks for the fast and precise answer!
Tested it and it works perfectly!
Thanks for your help
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB React
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No