Created
August 18, 2015 10:10
-
-
Save cpojer/0eb6e21d222b9352d157 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
import relayNestedRoutes from 'relay-nested-routes'; | |
const NestedRootContainer = relayNestedRoutes(React, Relay); | |
React.render( | |
<Router history={new BrowserHistory()}> | |
<Route component={NestedRootContainer}> | |
<Route | |
name="home" // added a name to the route | |
path="/" | |
component={App} | |
queries={HomeQueries} // and the query | |
/> | |
<Route | |
name="widget" | |
path="/widget/:id" | |
component={Widget} | |
queries={WidgetQueries} | |
/> | |
</Route> | |
</Router>, | |
document.getElementById('root') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think the only change this needs for the new
react-router-relay
API is just the top-levelReactRouterRelay.createElement
on theRouter
rather than theNestedRootContainer
.