Skip to content

Instantly share code, notes, and snippets.

@jhsu
Last active August 31, 2018 08:40
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 jhsu/c6a943ce572d43d63a53fabadbdfb119 to your computer and use it in GitHub Desktop.
Save jhsu/c6a943ce572d43d63a53fabadbdfb119 to your computer and use it in GitHub Desktop.
import { Route } from 'react-router';
import { NamesakeRouter } from 'react-router-namesake';
const App = () => (
<Route render={({ history}) => (
<NamesakeRouter
push={history.push}
routes={{
home: "/home",
users: "/users",
user: "/users/:userId"
}}
>
{/* your content */}
</NamesakeRouter>
)} />
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment