npm install react-router-dom
- Import BrowserRouter to index.js
import {BrowserRouter} from 'react-router-dom'
ReactDOM.render(
<React.StrictMode>
<BrowserRouter>
<App />
</BrowserRouter>
</React.StrictMode>,
document.getElementById('root')
);
- Import Switch and Route to App.js
import { Switch, Route } from 'react-router-dom'
- Create Routes
<Switch>
<Route path="/about">
About me
</Route>
<Route path="/">
Start Page
</Route>
</Switch>
- Import Link
import { Switch, Route, Link } from 'react-router-dom'
- Create links to navigate between routes
<ul>
<li>
<Link to="/">Hem</Link>
</li>
<li>
<Link to="/about">Om</Link>
</li>
</ul>
```