Our October sandbox build succeeded in 78 seconds, then the test command failed with one failed test and one failed snapshot. Use React Router if you want to choose how much of your React application's routing and data flow it owns. Skip it if your requirement is to keep a v5 application unchanged while adopting newer major versions: navigation blocking alone stopped one company's migration in issue #8139.
The decision starts with a mode, followed by a version. A loader is a function that supplies data to a route; an action handles a submission or other data change. If you already have those jobs covered, adopting the framework adds conventions you should have a reason to want.
What people use react-router for
React School's module built mission pages, individual mission routes and a custom 404 page; its author left persistent updates for a later Redux module. That is a useful boundary for a learning project: navigation and local state can work before saved application data does. The module review describes the result without claiming a production deployment.
| Who used it | What they did | What happened |
|---|---|---|
| React School's module author and learners | Built Home, Missions, NewMission, individual mission pages and NotFound | Learned route structure and navigation hooks; persistence was deferred to the next module. Module review |
| The presenter of React Router - Complete Tutorial | Connected home and profile pages with Link navigation and custom not-found handling | Demonstrated navigation without requesting a whole new page. Tutorial demonstration |
| GitHub commenter frankalbenesius | Attempted a company application's v5-to-v6 migration | Liked the new APIs, but postponed the migration until a recommended navigation-blocking replacement existed. Migration account |
| The presenter of React Router V7 Tutorial | Added an About route in Framework mode | Changed the route component to a default export after an error, then showed the page working. Framework tutorial |
The About-page demonstration is small but useful. The presenter registered a route and wrote its component, got an error, then corrected the export. It shows the practical difference between routing components inside your own React tree and handing route modules to a framework. The v7 tutorial demonstrates that convention in an actual application rather than a feature checklist.
What happened when we ran it
Our November 21 deployment attempt stopped at the lab's safety check because the repository had no Compose file. The check returned “unsafe repo: none of compose.yaml, compose.yml, docker-compose.yaml, docker-compose.yml exists”. “Unsafe repo” is the harness label for failing its Compose requirement. It is not a security verdict on React Router.
The November run header describes a deployment with every port bound to 127.0.0.1, but the failed safety step prevents treating that header as proof of a working application. The teardown reported “ok”. This attempt ended before a browser task produced a result.
The usable source-build evidence comes from our October 24 sandbox run at commit bb7c1f0. Installation succeeded in 24 seconds and the build succeeded in 78 seconds. Then Jest reported a failure in packages/react-router/__tests__/dom/data-browser-router-test.tsx, and the outer test step exited 1 after 139 seconds. Our sandbox measurement records both the successful build and the failed command.
| October 24 source-tree step | Recorded result |
|---|---|
| pnpm installation | Succeeded in 24 seconds; 1,478 dependencies recorded; 950 MB on disk |
| Build | Succeeded in 78 seconds |
| Test command | Failed, exit 1, after 139 seconds |
| Jest tests | 3,062 passed, 1 failed, 15 skipped, 3,078 total |
| Jest suites | 143 passed, 1 failed, 144 total |
| Snapshots | 1,028 passed, 1 failed, 1,029 total |
| Sandbox configuration | 3 CPUs, 8 GB RAM, image label lab-node:22, commit bb7c1f0 |
The tail names the failing file and snapshot count, then ends with ELIFECYCLE and “Test failed.” It gives you a concrete place to begin investigating a contributor checkout. The test runner's own time was 95.938 seconds, whereas 139 seconds describes the outer step. Those are different scopes in the same run.
The checkout contained 1,245 files, approximately 206,413 source lines and 10.5 MB before dependencies. The scan recorded monorepo workspaces and 19 CI workflow files, no Dockerfile and no top-level tests directory. The failing path above shows package-local tests despite that directory-scan result. The 950 MB installed footprint is contributor-environment disk use, not JavaScript sent to a visitor's browser.
Where people get stuck: upgrades change behavior as well as imports
Navigation blocking delayed frankalbenesius's v5-to-v6 company migration even though they liked the new APIs. In issue #8139, maintainer mjackson recommended staying on v5 when blocking was essential, or saving changing form values to browser storage and restoring them later. Timdorr subsequently reported adding a migration-documentation note in #8436.
The current mode guide lists useBlocker in Data and Framework modes, so “React Router has no navigation blocking” is obsolete as a blanket objection. For your form, separate the requirement into what happens before leaving, what the user chooses, and whether their draft survives a later return. Saving field values addresses recovery. Canceling an Electron process, which steveoh raised in the same issue, is a different application responsibility.
| Symptom and version context | What the discussion actually resolved | Your next step |
|---|---|---|
| v6 beta removed navigation-blocking hooks | mjackson recommended v5 or browser-storage recovery; timdorr added a documentation note. #8139 | Use the selected mode's documented blocking API and define draft recovery separately. |
| Clicking the current route should refresh its contents | mezod's per-Link Redux dispatch worked but required repetitive checks. #1982 | Decide whether you want fresh data, a component reset or a new document. |
| Early 1.0 release-candidate SSR produced a checksum mismatch | Nic128 solved one async onEnter case by embedding the server result and skipping the first client call. #2036 | Compare the first server and client render, including loaded route code and initial data. |
| Router context was undefined after the 0.13 upgrade | robbestad reported success after declaring contextTypes and using the matching context method. #975 | Keep that answer attached to 0.13; use modern docs for modern code. |
“Refresh the route” hides several requests. Revalidating means asking for route data again. Rerendering means React recalculates the interface, which does not by itself promise that a data request runs. Remounting replaces a component instance. Reloading the document asks the browser for a new page. In #1982, pdeva wanted component initialization to repeat without loading all scripts again; ryanflorence suggested calling the fetching function again. That exchange explains why a reload workaround can solve the wrong problem.
Choose how much architecture the router should own
Declarative mode handles URL matching and navigation; Data mode adds loaders and actions; Framework mode adds a Vite plugin and route-module tooling. The official mode guide makes architectural control the decision, rather than a yes-or-no choice about server rendering.
| Mode | What you get | When I would choose it |
|---|---|---|
| Declarative | Matching, navigation and active-link state | Your data layer already owns fetching and pending states. |
| Data | Loaders, actions, pending states and fetchers | You want route-aware data handling while controlling bundling and server abstractions. |
| Framework | Data features plus Vite integration, route types, code splitting and rendering strategies | You want those pieces coordinated through route modules. |
Those distinctions come from the mode guide's decision advice. For an existing application, start by naming the machinery you would replace. Data mode is a reasonable stopping point if loaders and actions solve your problem while the current bundler and server are doing their jobs. Framework mode earns its place when route modules and integrated rendering remove work you currently own.
Server-side rendering, or SSR, sends rendered HTML from the server before the browser takes over. The guide says every mode supports any architecture and deployment target. Framework mode supplies more integration around that work. Choosing the smallest mode therefore does not automatically rule out SSR, and needing SSR does not alone settle the mode decision.
Package advice needs a major-version label
For new applications, the current package guide recommends react-router; it describes react-router-dom as the common v6 browser package, a v7 compatibility layer and removed in v8. Syncfusion's version table is more useful than an unversioned instruction to install both.
For a react-router install or react-router npm search, npm install react-router is the current package guide's command. For a react-router-dom install or react-router-dom npm search, first identify the major version that the example targets. The similarly named react-router/dom is an import path inside the main package, not a request to add a second package. The package guide shows that path for DOM-specific RouterProvider integration.
The confusion has a recorded cost. In a January 2025 r/react discussion, the questioner described duplicate suggestions after installing both packages. One reply explained the older browser/core split, while i3orn2kill said v7 no longer required the DOM package. A plausible explanation can still be the wrong instruction for your project's major version.
Security updates belong in the version decision
React Router's November 18 announcement recommends 7.18.6 or 8.5.2 for its reported security fixes. That is the useful action in the project's announcement on X. It gives maintainers a patch target within v7 as well as one on v8, so security maintenance and a major-version migration need separate decisions.
Choose the target for the release line you actually operate, then consult the project's advisories for the relevant packages. A client routing library and a server-rendered application expose different parts of a system; an announcement alone is too coarse to classify an individual installation. The October build predates this announcement. Passing compilation is a different question from whether your deployed dependency tree contains the recommended patches.
React Router vs TanStack Router, TanStack Start and Next.js
React Router Framework mode is the comparison the official guide recommends when you are considering Next.js or TanStack Start. That advice helps you compare similar levels of architectural commitment instead of comparing a small library configuration with an entire framework.
| Comparison | What the sources support | Decision |
|---|---|---|
| React Router vs TanStack Router | TanStack describes its router as type safe; the research discussions contain no direct feature evaluation. TanStack repository | Compare your actual route and parameter workflow; don't award a speed win from the names. |
| React Router Framework vs TanStack Start | punkpeye asked about 500+ routes and 1,000 requests per second; repeating_bears and octatone recommended an experiment. Scaling thread | Treat those figures as a proposed workload, not achieved throughput. |
| React Router vs Next.js | The mode guide sends Next.js evaluators toward Framework mode. Official decision advice | Compare framework adoption with framework adoption. |
| React Router vs react-router-dom | The latter changes role across v6, v7 and v8. Package history | This is a version and import question, rather than competing routers. |
| Link vs ordinary anchor navigation | The Complete Tutorial presenter demonstrated internal navigation without a full page refresh. Navigation demonstration | Use the demonstration to understand client routing; it is not a latency benchmark. |
For the large-application question, I would compare generated route trees before committing to a migration. Keep the server, data work and request mix equivalent, and distinguish hundreds of distinct route definitions from hundreds of URLs matched by a few parameterized routes. Honey-Entire raised exactly that route-count distinction in the scaling discussion. Moving a large application first would make the experiment expensive before it answered the question.
What the other reviews get wrong
LogRocket's mode table marks SSR as unsupported in Declarative mode, whereas React Router's own guide says every mode supports any architecture and deployment target. Read LogRocket's comparison alongside the official decision advice. Integrated tooling and architectural possibility are different claims.
Syncfusion's package article labels 8.3.1 current in its dated version note. Its package-history explanation can still be useful, but that patch recommendation has been overtaken by the November announcement naming 8.5.2 and 7.18.6. Don't carry a version recommendation forward just because the surrounding article explains imports well.
GeeksforGeeks calls react-router-dom essential for SPAs, then shows a dependency example using v6.23.1. That tutorial needs its v6 context attached: the newer package guide describes different package choices for v7 and v8.
The project's own older docs need version labels too. The v7.0.0 optional-static-segment example uses lowercase component for users/:userId/edit?; the later routing page uses element. Copy the example belonging to the documentation version you intend to use.
Questions people ask
React-router-dom was the common browser package in v6, became a compatibility layer in v7 and was removed in v8, according to the package guide.
What is the difference between react-router and react-router-dom?
React-router is the primary package in the newer guidance; react-router-dom's role depends on your major version. For react-router vs react-router-dom, use the v6/v7/v8 package table, rather than treating the DOM package as a more advanced edition.
What are the latest react-router and react-router-dom versions?
The npm registry returned react-router 8.5.2 and react-router-dom 7.18.6 on November 21, 2026. For react-router latest version, that is the main package result; for react-router-dom latest version, use the compatibility package result. Different major numbers fit the package history: v8 removed the DOM compatibility package.
Where can I find the available react-router-dom versions?
Use npm's react-router-dom package-version listing for react-router-dom versions, and keep the guide's major-version history beside it. A version appearing in the registry is not a recommendation to add that package to a new v8 application.
Do I need both react-router and react-router-dom installed?
No for the newer main-package approach: i3orn2kill's v7 reply says to use react-router, and the package guide describes removal of the compatibility package in v8. Keep existing v6 imports attached to their own upgrade instructions.
How does React Router compare with TanStack Router?
React Router offers three modes, including Framework mode's typed route-module API; TanStack's repository describes a type-safe router. For react-router vs tanstack router, compare a representative route and its data requirements against React Router's mode APIs.
Should I choose React Router or Next.js?
Framework mode is React Router's recommended starting point for people considering Next.js. For react-router vs nextjs, that official advice identifies what to compare; it does not declare a winner for your application's rendering and data needs.
How do React Router Framework mode and TanStack Start compare for 500+ routes and 1,000 requests per second?
Those figures describe punkpeye's requested comparison, not a measured result. Repeating_bears recommended running an experiment, and octatone suggested a test application instead of a migration in the r/reactjs thread.
How do I protect unsaved changes when navigating away from a route?
The mode guide lists useBlocker for Data and Framework modes. Pair that API choice with an explicit recovery policy; mjackson's browser-storage suggestion describes preserving form values as an alternative user experience.
How do I reload the current route or refresh its data without reloading the whole page?
Refreshing data and remounting a component are separate requests. In #1982, ryanflorence suggested calling the data-fetching function again; mezod reported working per-Link Redux actions with repetitive checks. The current mode table lists useRevalidator in Data and Framework modes.
Does a relative Link using '..' go up a URL segment or a matched route?
The v6 overview says relative links traverse the route hierarchy by default; relative="path" selects path-segment traversal. Its worked example removes both project/:projectId segments for a route-relative parent link.
How can I use React Router for server rendering?
Framework mode integrates SSR, SPA and static rendering strategies through its Vite tooling. The mode guide also says every mode supports any architecture and deployment target, so the choice is how much integration you want.
Why do server-rendered async routes produce a client markup mismatch?
In the historical 1.0 release-candidate issue #2036, participants described an initial empty client render while asynchronous work was pending. Nic128 reported solving their onEnter case by carrying the initial server result into the page and skipping the first client fetch.
What we have not tested yet
Our evidence stops at a built source tree with a failing test command and a later Compose check that stopped deployment. We have not tested a production route tree, browser navigation, form recovery, SSR hydration, request throughput, memory under application load, deployment adapters or accessibility. The November header's deployment wording conflicts with the failed safety step; it cannot support a claim that an application started successfully.
The October tail does not expose the failed assertion or snapshot diff. It cannot identify an environment cause, a package cause, a harmless formatting difference or a user-facing routing defect. The image label lab-node:22 is recorded configuration, not proof of an exact runtime or operating-system version. Full toolchain logs and the missing failure detail would be needed for that diagnosis.
The security announcement supplies upgrade targets but not the affected ranges needed to audit an individual installation. We have not performed a dependency vulnerability scan or reproduced those fixes. The older issue workarounds belong to their reported versions; they are not current regression results, universal fixes or proof that useBlocker matches every behavior of the old Prompt API.
No side-by-side benchmark settles React Router versus TanStack Start or TanStack Router here. Tutorial completions and forum comments show particular tasks and reported friction, not production adoption or support capacity. For your next decision, implement one route with the data loading, unsaved edits and rendering behavior your application requires, using the mode and major version you plan to keep.


