React Router
Declarative routing library for building single-page React applications.
3. Used by agents' projects
Dependency in 292 public GitHub projects set up for AI coding agents that we scanned (4.7%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What React Router does
React Router lets a project choose how much of it to adopt: the README says you can use it "maximally as a React framework or minimally as a library with your own architecture."
React Router popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How React Router is used
- React Router is a dependency in 292 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (6.0% of the 4,867 JavaScript/TypeScript ones), #4 of 76 in web frameworks.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 1,592; those are left out of every share on this page.
- The most used alternative in our scan is TanStack Router (50 projects).
- Projects that use it most often also use Vite (90.4%), React (99.0%), Lucide React (65.4%).
- It is more common in projects set up for Roo Code (9.9%) than for OpenAI Codex (2.6%).
By coding agent
Often used with
React Router in practice
Strengths
The website says the move from v7 to v8 is "a non-breaking upgrade" and tells users to "Keep using React Router the same way you already do." The site's card for v7 users says "Upgrade to v8 in just a few steps."
The website links a guide called "Adopt Framework Features" for people who already have a React Router app and want the newer framework features in it.
The README lists packages named for Node, Express, Architect and Cloudflare under <code>./packages</code>, next to the core <code>react-router</code> package.
On the Maxima Therapy site, the builders put a hero carousel in a layout above an <code>Outlet</code>. They wrote about it on Codrops. Page data changes with the route, and the carousel does not re-render.
Watch out for
The website lists the v8 baseline as Node 22+, Vite 7+, React 19+ and ESM-only. The maintainers say the higher baselines let them "keep the core of React Router simple."
The README links separate docs for v7 and v6 under reactrouter.com. Docs for v5 are on their own subdomain, <code>v5.reactrouter.com</code>.
More about React Router
Funding
- Open Collective: https://opencollective.com/react-router
Head to head
- React Router vs TanStack Router used together in 1 projects
Packages around it
- vite: Build tool and dev server
- react: UI library
- framer-motion: Animation library
- tailwindcss: Utility-first CSS
- @react-three: React renderer for Three.js
- three: 3D graphics library
More in Web frameworks
Alternatives
React Router This page
Modern, type-safe routing library with file-based routing for React.
Get started
Install it.
npm install react-router-domRules for your agent
## React Router
- Follow the install guide that matches the project's mode: `reactrouter.com/start/framework/installation` for framework use, `reactrouter.com/start/library/installation` for library use.
- On v8, target Node 22+, Vite 7+ and React 19+. The package is ESM-only, so write ESM imports.
- For a v7 project, upgrade using the guide at `reactrouter.com/upgrading/v7`.
- To add framework features to an existing React Router app, follow the site's "Adopt Framework Features" guide.
- When the installed major is older, read the matching docs: `reactrouter.com/v7`, `reactrouter.com/v6` or `v5.reactrouter.com`.
- For server runtimes, pick from the packages the README lists: `@react-router/node`, `@react-router/serve`, `@react-router/express`, `@react-router/architect`, `@react-router/cloudflare`.