Created
December 7, 2017 20:52
-
-
Save jacobwallenberg/84f1702789c4afe24607765b337b6af8 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 { | |
BrowserRouter as Router, | |
Route, | |
Link | |
} from 'react-router-dom' | |
const ParamsExample = () => ( | |
<Router> | |
<div> | |
<h2>Accounts</h2> | |
<ul> | |
<li><Link to="/netflix">Netflix</Link></li> | |
<li><Link to="/zillow-group">Zillow Group</Link></li> | |
<li><Link to="/yahoo">Yahoo</Link></li> | |
<li><Link to="/modus-create">Modus Create</Link></li> | |
</ul> | |
<Route path="/:id" component={Child}/> | |
</div> | |
</Router> | |
) | |
const Child = ({ match }) => ( | |
<div> | |
<h3>ID: {match.params.id}</h3> | |
</div> | |
) | |
export default ParamsExample |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment