is react-router a wrapper over browser history push and pop state array?
Yes, React Router is essentially a wrapper around the browser's history API, which includes methods like pushState and popState. Here's a brief explanation:
This native browser API allows manipulation of the browser's session history through methods like pushState, replaceState, and the popstate event.
<BrowserRouter>
, <Link>
, and hooks like useNavigate()
that internally use pushState and popState.
When you use these components/hooks, React Router updates the URL and manages the history stack without full page reloads.