Skip to content

<IndexRoute> is not reached under multiple <Route> elements with path='' #2429

@hyzhak

Description

@hyzhak

Hello guys! I have 2 groups of pages Regular and Lite (for landing pages). So I split my route to the 2 groups. And default '/' should be in regular group of pages. So my router looks like this one:

<Route path='/' component={require('./components/BaseLayout')}>
  <Route path='' component={require('./components/RegularLayout')}>
    <IndexRoute component={require('./pages/Index')}/>
    .... some regular pages ....
  </Route>
  <Route path='' component={require('./components/LiteLayout')}>
    .... some lite pages
  </Route>
  <Route path='*' component={require('./pages/NotFound')}/>
</Route>

But I get problem that IndexRoute is never reached and if I have path='/' none of Index page or RegularLayout are rendering. Everything work if I put some path for RegularLayout but I don't need it. Do you have any ideas what is wrong and how can archive such use case? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions