React-redux-starter-kit: Multiple Layouts

Created on 25 Apr 2016  路  4Comments  路  Source: davezuko/react-redux-starter-kit

Hey guys, I am trying to figure out how to use the routes in the Plain Route format, I am used to JSX. First off, to get code splitting with async reducers and middleware, do you have to use the the Plain Route structure, or can it be achieved with JSX?

Second, we have two main layouts, and I am trying to figure out how I can call the createRoutes function, but make multiple top level routes with different Layouts, using the Plain Route structure. Any help would be great!

Most helpful comment

All 4 comments

Hello,
could you show the routes/structure you had in JSX which you want to be translated to plain routes ?

I don't have access to the specific code but it looks like the following example:

<Route` path="/" component={Containers.App}>
  <Route component={Containers.Layout1}>
    <IndexRoute component={Containers.Home}/>
    <Route path="about" component={Containers.About}/>
    <Route path="faq" component={Containers.Faq}/>
    <Route path="etc" component={Containers.Etc}/>
  </Route>

  <Route component={Containers.Layout2}>
    <Route path="products" component={Containers.Products}/>
    <Route path="gallery" component={Containers.Gallery}/>
  </Route>
</Route>

The trick was providing a route with no path, can this also be done with a Plain Route?

I really don't have much to add to here, sorry. I suggest posting this either in StackOverflow or at least passing it along to the fine folks at react-router, since this is more of an implementation question than something specific to the starter kit. Sorry I couldn't be of more help, best of luck!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maxkrieger picture maxkrieger  路  4Comments

nie-xin picture nie-xin  路  4Comments

bhuffman picture bhuffman  路  3Comments

renanvalentin picture renanvalentin  路  5Comments

marcelloromanelli picture marcelloromanelli  路  5Comments