Protected nested routes

I am using Redirects for my Authenticated routes and Im trying to implement this to show nested routes within a protected route.

I have a sub menu after my users login so id like this to have a sensible hierarchy.

When i add this route to my Routes.js file it displays normally with the correct URL but this component takes over the page and removes the sub menu.

<AuthenticatedRoute path="/dashboard" component={Dashboard} props={childProps} />
<AuthenticatedRoute path="/dashboard/settings" component={Settings} props={childProps} />

I also tried using render props on my Route component in my parent component but I get my 404 component.

I’ve done this before but not with authentication. If someone could please point me in the right direction this would be great!

Hi there, I’m not totally clear what the issue here is. The routes are meant for the component to take over the rendering. So any sub menu needs to placed at a level above that component.

Thank you @jayair. I realized this the next morning. long day at the office

1 Like

hey… i am having in the same problem. please help me. i have not understand the sentence (any sub menu needs to placed at a level above that component). can i get the code of Router.js and the nested routes?

Well I’m not sure about your specific case. Can you describe what you are trying to do?

thanks for your reply… i already got this :blush: :blush: :blush: :blush: