I have a simple App that uses BrowserRouter from \'react-router-dom\' v4. I\'m trying to access the location.pathname property from within the &l
BrowserRouter
location.pathname
&l
Since react-router v5.1.0 you can use useLocation.
useLocation
https://reactrouter.com/web/api/Hooks/uselocation
class App extends Component{ render(){ const location = useLocation(); return ( //... ); } } // ...