Skip to content

Instantly share code, notes, and snippets.

@sreynen
Created September 17, 2017 21:28
Show Gist options
  • Save sreynen/a507e883681891c6164700ab9cd2e4db to your computer and use it in GitHub Desktop.
Save sreynen/a507e883681891c6164700ab9cd2e4db to your computer and use it in GitHub Desktop.
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