Created
October 28, 2017 12:20
-
-
Save Aperyon/ba4ad691dba51e2debdd8dd39e52e3f4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 React from 'react'; | |
import { Link, Redirect, Route } from 'react-router-dom'; | |
const Nav = () => ( | |
<ul> | |
<Link to="/friends/"><li>Friends</li></Link> | |
<Link to="/books/"><li>Books</li></Link> | |
</ul> | |
) | |
const Friends = () => <h1>Friends</h1> | |
const Books = () => <h1>Books</h1> | |
const App = () => ( | |
<div> | |
<Nav /> | |
<Redirect exact from="/" to="/friends/" /> | |
<Route path="/friends/" component={Friends} /> | |
<Route path="/books/" component={Books} /> | |
</div> | |
) | |
export default App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment