Created
March 22, 2016 04:30
-
-
Save GriffinHeart/a6f97af37259be633235 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//client side | |
match({ routes, location }, (error, redirectLocation, renderProps) => { | |
render( | |
<Provider store={store}> | |
<ContextHolder context={context}> | |
<Router {...renderProps} children={routes} history={Location} /> | |
</ContextHolder> | |
</Provider>, | |
appContainer | |
); | |
}); | |
//server side | |
match({ routes, location: req.url }, (error, redirectLocation, renderProps) => { | |
data.body = ReactDOM.renderToString( | |
<Provider store={store}> | |
<ContextHolder context={context}> | |
<RouterContext {...renderProps} /> | |
</ContextHolder> | |
</Provider> | |
); | |
}); | |
//routes | |
<Route> | |
<Route path="login" component={LoginPage} /> | |
<Route path="/" component={App} > | |
<IndexRoute component={Dashboard} /> | |
<Route path="transaction/:id" component={ConsumerTransaction}/> | |
<Route path="about" getComponent={getContextComponent} /> | |
<Route path="privacy" getComponent={getContextComponent} /> | |
</Route> | |
<Route path="*" component={NotFoundPage} /> | |
</Route> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment