Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


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



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • 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