Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cpojer
Created August 27, 2015 23:23
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/7b274ea7e255481e1d2d to your computer and use it in GitHub Desktop.
Save cpojer/7b274ea7e255481e1d2d to your computer and use it in GitHub Desktop.
import ReactRouterRelay from 'react-router-relay';
// ...
React.render(
<Router
history={new BrowserHistory()}
createElement={ReactRouterRelay.createElement}>
<Route
name="home" // added a name to the route
path="/"
component={App}
queries={AppQueries} // and the query
/>
<Route
name="widget"
path="/widget/:id"
component={Widget}
queries={WidgetQueries}
/>
</Router>,
document.getElementById('root')
);
@taion
Copy link

taion commented Sep 27, 2015

Probably best to change https://gist.github.com/cpojer/7b274ea7e255481e1d2d#file-app-js-L7 to history={history} given further API changes to react-router.

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