Routing with React Router

Everything so far has lived at one URL. That is fine for a widget and hopeless for an application: a user who has drilled into a product cannot bookmark it, cannot mail the link to a colleague, and loses the page the moment the back button is pressed. Routing makes the URL the source of truth for which screen is showing, without giving up the single page that makes a React 7,897 application feel instant.

React Router 139,386 is the library almost every React application reaches for: a separate package that reads the address bar, matches it against patterns you declare, and renders the components that win. This section uses version 8.4.0, released on 15 September 2026, with React 19.3.0; Node 22.22 and React 19.2.7 are the minimum versions it installs against.

A full page load versus a client-side route change
A full page load versus a client-side route change

Start with the declarative pieces every mode shares; Data Routers continues with data routers.

Subsections