Skip to content

Instantly share code, notes, and snippets.

@jacobwallenberg
Created December 7, 2017 20:52
Show Gist options
  • Save jacobwallenberg/84f1702789c4afe24607765b337b6af8 to your computer and use it in GitHub Desktop.
Save jacobwallenberg/84f1702789c4afe24607765b337b6af8 to your computer and use it in GitHub Desktop.
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