MENU
<BrowserRouter>
This is a <Router> that uses the HTML5 history API (pushState, replaceState and the popstate event) to keep your UI in sync with the URL.
<BrowserRouter basename={optionalString}>
<App />
</BrowserRouter>Your web server needs to serve the same page at all URLs that are managed client-side by React Router.
The old "forceRefresh", "getUserConfirmation", and "keyLength" attributes are gone. BrowserRouter handles history automatically for you; if you need to navigate from inside a component, use the useNavigate hook:
let navigate = useNavigate();
then call navigate("/somewhere") to push a new entry, or navigate("/somewhere", { replace: true }) to replace the current one.