Topic: Protected Routes With NavItem and SideNavItem
rgrashel free asked 5 years ago
Hello,
I am looking to see if there are any examples of using "protected" or "private" routes with MDBNavItem? I see from the bundled navigation pages in the Admin Template that BrowserRouter wraps the MDB NavItem components. Is it possible to take an existing HOC (higher order component) and wrap MDBNavItem with it? There are several pages that I would like to ensure that someone is logged in -- and if they aren't logged in, then redirect them to a login page.
Jakub Mandra staff answered 5 years ago
Hi,
We do not have examples with more complex routing than int the Admin Template.
It should be possible to use HOC, but I'm not sure if you would not have to cloneElement to attach your attributes.
Best,
Jakub
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB React
- MDB Version: 4.11.0
- Device: Desktop
- Browser: Chrome
- OS: Linux
- Provided sample code: No
- Provided link: No