Skip to content

Instantly share code, notes, and snippets.

@takanorip
Created December 10, 2018 00:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save takanorip/101c1df97a35a8f52c1c29d04cf2c90e to your computer and use it in GitHub Desktop.
import { Route, Switch } from 'react-router';
import { Link } from 'react-router-dom';
import React from 'react';
import routes from './routes';
const Layout = () =>
<div>
<nav>
<ul>
<li>
<Link to="/">Home</Link>
</li>
<li>
<Link to="/another">Another page</Link>
</li>
</ul>
</nav>
<Switch>
{routes.map(route => <Route key={route.name} {...route} />)}
</Switch>
</div>;
export default Layout;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment