- Wrap the entry point usually index.js
import { BrowserRouter } from 'react-router-dom'
ReactDOM.render(<BrowserRouter><App\></BrowserRouter/>, documnet.querySelector('#root));
- SWITCH VS just ROUTES (can use both)
things in switch are exclusive, only the first one gets rendered once matched so order matters. Check documentation for further explanation. Either way place your Routes or switches in place where things can change. for eg in main app you may want to switch between views below your nav. so below your nav you have routes and/or switches. >import { Switch, Route } from 'react-router-dom'