React-router: Deep linking: Child route in an already nested route

Created on 16 Mar 2017  路  2Comments  路  Source: ReactTraining/react-router

Hello,

I have a question for the react-router community. I have been looking all over for an example that has a nested child route inside of an already nested route. There is plenty of documentation out there that shows using a parameter at this level, but never an explicit path. Is there a reason why this should not work? I have pasted my configuration below.

Bottom line: I want to hit '/profile/type' and the rendered JSX should be AccountType nested in ProfileContainer inside App.

I just would prefer to have a specific path to this component. Each other the parent components make use of children. For the record, /profile will render App --> ProfileContainer --> About. So the IndexRoute is working as it should. But specific routes that are peers of About cannot be reached at that deeper level.

Is this a bug? Is there something wrong with my configuration? I just would not think that it is only possible to nest once with react-router.

Thank you

<Router history={syncedHistory}>

     <Route path="/" component={App} >
         <IndexRedirect to="profile" />

        <Route path="profile" component={ProfileContainer}>
           <IndexRoute component={About} />
           <Route path="type" component={AccountType} />
         </Route>

     </Route>
</Router>

Most helpful comment

Alright, well I was trying to give react-router the benefit of the doubt and not outright declaring it a bug. But my code is in that configuration and it doesn't work. So if semantics are the only thing preventing you from taking a look into it, then I think its a bug since the code is not working as expected.

So either the configuration is not supported or it is a bug in the code.

All 2 comments

This is a bug tracker, not a support system. For usage questions, please use Stack Overflow or Reactiflux. Thanks!

Alright, well I was trying to give react-router the benefit of the doubt and not outright declaring it a bug. But my code is in that configuration and it doesn't work. So if semantics are the only thing preventing you from taking a look into it, then I think its a bug since the code is not working as expected.

So either the configuration is not supported or it is a bug in the code.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Waquo picture Waquo  路  3Comments

nicolashery picture nicolashery  路  3Comments

yormi picture yormi  路  3Comments

ArthurRougier picture ArthurRougier  路  3Comments

ackvf picture ackvf  路  3Comments