browserrouter current path

Solutions on MaxInterview for browserrouter current path by the best coders in the world

showing results for - "browserrouter current path"
Maximiliano
11 Sep 2019
1import { useLocation } from 'react-router-dom'
2
3function HeaderView() {
4  const location = useLocation();
5  console.log(location.pathname);
6  return <span>Path : {location.pathname}</span>
7}
8
9