Created
September 17, 2017 21:28
-
-
Save sreynen/a507e883681891c6164700ab9cd2e4db 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 React from 'react' | |
import { BrowserRouter as Router, Route, Link } from 'react-router-dom' | |
import ReactDOM from 'react-dom' | |
class Example extends React.Component { | |
render() { | |
return ( | |
<Router> | |
<div> | |
<Route | |
exact | |
path="/" | |
render={() => ( | |
<Link to={`/%E2%98%83/frosty`}>Frosty</Link> | |
)} | |
/> | |
<Route | |
path={'/\u2603/:name'} | |
render={({ match }) => { | |
return ( | |
<div>{match.params.name}, the snowman</div> | |
) | |
}} | |
/> | |
</div> | |
</Router> | |
) | |
} | |
} | |
ReactDOM.render( | |
<Example />, | |
document.getElementById('container'), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment