Skip to content

Instantly share code, notes, and snippets.

@jikkujose
Created December 3, 2018 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jikkujose/d81a71b00b5d93bf60ebe334742f81ab to your computer and use it in GitHub Desktop.
Save jikkujose/d81a71b00b5d93bf60ebe334742f81ab to your computer and use it in GitHub Desktop.
yarn add react-router-dom --save
import { BrowserRouter as Router, Switch, Route } from "react-router-dom"
<Router basename={basename}>
<Switch>
<Route exact path="/" component={Home} />
<Route exact path="/blog" component={Blog} />
<Route
exact
path="/blog/tech-stack"
component={() => <Post {...techStack} />}
/>
<Route path="*" component={NotFound} />
</Switch>
</Router>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment