Skip to content

Instantly share code, notes, and snippets.

@cpojer
Created August 18, 2015 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cpojer/0eb6e21d222b9352d157 to your computer and use it in GitHub Desktop.
Save cpojer/0eb6e21d222b9352d157 to your computer and use it in GitHub Desktop.
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')
);
@taion
Copy link

taion commented Aug 27, 2015

I think the only change this needs for the new react-router-relay API is just the top-level ReactRouterRelay.createElement on the Router rather than the NestedRootContainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment