Created
December 10, 2018 00:47
-
-
Save takanorip/101c1df97a35a8f52c1c29d04cf2c90e 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 { 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