Mantra - react-router



I found mantra very interesting but I didn’t succeed to make it work with react-router.
Did someone have an exemple about how to use mantra with react-router ?

Thanks !


Simply replace FlowRouter to RR here:


You may need to change components a bit.


The problem seems to be react-router wants me to regroup all my routes in the same place eg:
render(( <Router history={browserHistory}> <Route path="/" component={App}> <Route path="login" component={Login}/> <Route path="users" component={Users}/> </Route> </Router> ), document.body)

I didn’t succeed in putting each route in each module.


Yes. You need to keep routes in a single module.
Use this pattern:


Thanks it’s working :slightly_smiling:


In terms of route modularity and the Mantra style, would it be possible to do something similar to the huge-apps example for React-Router?

Example Here


Please consider reading my proposition here.