React Router has been the default routing library for React since 2015. It's in more codebases than any other router, it's in the Create React App tutorials people still read, and it's the thing most developers reach for when they need to add routing without thinking about it.
TanStack Router reached 1.0 in late 2023. It's two and a half years old, and it has already captured somewhere between 40% and 45% of React Router's weekly download volume — a catch-up pace that's genuinely rare for a library in a market with an entrenched incumbent.
That's the interesting part. The downloads still favour React Router by a wide margin, but the trajectory suggests something is shifting, especially in new projects. This post is about what's actually driving that, what the tradeoffs look like in practice, and whether switching is worth it if you're already on React Router.
Quick answer: which should you use?
| Your situation | Use this |
|---|---|
| Existing React Router project that works | React Router |
| New TypeScript-heavy app with complex search params | TanStack Router |
| You want the largest hiring pool and most tutorials | React Router |
| You're already using TanStack Query | TanStack Router |
| You need file-based routing with full type inference | TanStack Router |
| You want the lowest migration risk from v6 | React Router v7 |
| Your routing bugs are usually invalid params or broken links | TanStack Router |
Default recommendation: React Router for existing projects, TanStack Router for new TypeScript-first apps. That's the honest split. The 80/20 rule that's emerged in 2026 React discussions is that React Router remains the mainstream choice and TanStack Router is the mainstream second choice — and for a new back-office or dashboard app with heavy TypeScript, the scale has tipped toward TanStack.
The market numbers, accurately
Download counts for these packages vary wildly depending on where you look, because measurement methodologies differ. Here's the honest range from sources published in 2026.
| Source | React Router | TanStack Router |
|---|---|---|
| pkgpulse (April 2026) | ~53.8M/week | ~8.5M/week |
| quidproquo (August 2026) | 44.2M/week | 19.7M/week |
| agentgid (November 2026) | 56.4M/week | 24.1M/week |
| humanloads (November 2026) | 76.0M/week | — |
The absolute numbers move around, but the ratio is consistent: React Router has somewhere between 2x and 6x TanStack Router's volume depending on the snapshot. The more telling number is new repo adoption.
Among 4,864 JavaScript/TypeScript projects set up for AI coding agents, React Router appears in 7.1% of repos created in the last 90 days, and TanStack Router in 3.9%. In older repos, the split is 11.6% vs 1.9% — a 6x gap. In new repos, it's less than 2x.
That's the signal. New projects are choosing TanStack Router at roughly three times the rate of older projects. React Router's lead is real, but it's largely inherited from the existing codebase base rather than from active new adoption.
Why TanStack Router grew this fast
Three architectural decisions, none of which React Router could patch in.
1. Type-safe routes, end to end
In TanStack Router, routes are defined as typed objects, and the types propagate through the entire API. Navigating to a route that doesn't exist is a compile-time error, not a runtime 404. Passing the wrong params to a route is a type error. Building a link from a route object gives you autocomplete on the path, the params, and the search schema.
const postRoute = createRoute({
getParentRoute: () => rootRoute,
path: '/posts/$postId',
component: PostPage,
});
// Navigating to a route that doesn't exist is a type error
<Link to="/posts/$postId" params={{ postId: '123' }}>
Read post
</Link>
The practical effect: routing bugs that would normally show up as broken links in production become red squiggles in your editor. If your routing bugs usually look like "the link went to the wrong place" or "the param was undefined," TanStack Router catches those before they ship.
2. Search params as first-class citizens
This is the differentiator that convinces more teams than the type safety. In most routers, search params are strings you parse and validate by hand. In TanStack Router, you define a schema for a route's search params, and the router handles parsing, validation, serialization, and type inference.
const searchSchema = z.object({
page: z.number().default(1),
sort: z.enum(["newest", "oldest", "popular"]).default("newest"),
tags: z.array(z.string()).default([]),
});
const productsRoute = createRoute({
getParentRoute: () => rootRoute,
path: "/products",
validateSearch: searchSchema,
component: ProductsPage,
});
Now useSearch() returns { page: number; sort: 'newest' | 'oldest' | 'popular'; tags: string[] }. Invalid URLs are caught at the router boundary instead of causing subtle bugs deeper in the component tree. For dashboards with filter state in the URL — the exact scenario where search params are load-bearing product logic — this is a meaningful improvement over doing it by hand.
3. Loaders that integrate with TanStack Query
TanStack Router's loaders can prefetch data before the route renders, and they integrate directly with TanStack Query. The combination eliminates loading waterfalls: the router knows what data the route needs, fetches it in parallel with the code split, and renders with data already present.
If you're already on TanStack Query, this integration is the strongest argument for TanStack Router. The two libraries were designed to work together, and the mental model is cohesive.
What React Router does better
React Router's lead isn't just inertia. It has real advantages.
The largest ecosystem. More tutorials, more Stack Overflow answers, more blog posts, more YouTube videos, more people who already know it. When something goes wrong at 11pm the night before a release, that matters.
The hiring pool. If you're staffing a team or handing off a codebase, React Router is the router most React developers already understand. That reduces onboarding cost and reduces risk.
A clearer path from v6. React Router v7 is the lowest-friction upgrade from v6. TanStack Router is a rewrite. If your team is on React Router v6 and it's working, v7 is a one-afternoon decision. Migration to TanStack Router is not.
The Remix model, incrementally. React Router v7 absorbed Remix and now supports route modules, loaders, actions, and server-aware patterns. Teams can adopt these incrementally without switching libraries. If you're moving toward a Remix-style full-stack model, React Router is the path.
Familiarity across the industry. React Router is what most React developers learned first. That's not an architectural advantage, but it's a real operational one.
The version-history problem
One thing that has driven TanStack adoption more than any feature comparison: React Router's version history has been turbulent.
The v5 → v6 rewrite was a breaking change that required substantial migration work across thousands of codebases. v7 then absorbed Remix and split into library mode and framework mode, which introduced another set of decisions and another migration surface. None of this was unreasonable — the framework had to evolve — but it accumulated community fatigue.
TanStack Router's counter-argument is architectural: the type safety and search-params story are gaps React Router can't close with patches, because they're foundational design decisions. That framing has landed with teams that want a stable target for the next five years.
Bundle size
| Router | Minified + gzipped |
|---|---|
| React Router v7 | ~58.4 KB |
| TanStack Router | ~40.2 KB |
TanStack Router is roughly 30% smaller. Neither is large enough to be the deciding factor on its own, but if you're optimizing bundle size, TanStack's smaller footprint is a real advantage. Our reduce JavaScript bundle size guide covers the broader strategy.
Migration: is it worth switching?
For most existing React Router projects, no. The migration is a rewrite of every route definition, every <Link>, every useParams call, and every navigation. That's not a weekend project on a mature codebase.
Switch to TanStack Router if:
- You're starting a new TypeScript-heavy app, especially a dashboard with URL-driven filter state.
- You're already using TanStack Query and want the cohesive stack.
- Your routing bugs are consistently type bugs — invalid params, broken links, query-string drift.
- You're rewriting the routing layer for another reason anyway.
Stay on React Router if:
- You're on v6 or v7 and it's working.
- Your team is more comfortable with the React Router mental model.
- You value the hiring pool and the tutorial ecosystem.
- You're moving toward Remix-style route modules and want to adopt them incrementally.
The honest version: for a brand-new app with a TypeScript-heavy team and complex URL state, TanStack Router is the stronger choice in 2026. For everything else, React Router is still the safer default, and "it works" is a legitimate reason to stay.
A real story: the dashboard where URL state was the whole product
A team I worked with built an internal analytics dashboard. Every filter — date range, segment, metric, comparison mode, sort order — lived in the URL so users could share links and bookmark views. The routing layer was React Router v6.
The product worked, but a specific class of bug kept recurring. A shared link would land on a page with a filter that wasn't valid for the current dataset. A sort parameter would be spelled differently in two code paths. A new filter would be added and the URL serialization would silently break for older links.
Each individual bug was small. Together they were a steady tax: every filter change required hand-written parsing, validation, and serialization, and every new team member got it slightly wrong.
We migrated the routing layer to TanStack Router with a Zod schema per route for search params. The migration took about three weeks. The recurring bugs stopped immediately — invalid URLs were caught at the router boundary and normalized before any component saw them, and adding a new filter meant extending the schema rather than touching five places.
The lesson: TanStack Router's search-params story isn't a type-safety enthusiast's talking point. For apps where the URL is the state, it eliminates an entire category of bugs.
The TanStack stack, if you go that way
One reason TanStack Router's adoption has accelerated is that it's the URL-state piece of a coherent stack that's emerged as the default for serious SPAs:
- URL state → TanStack Router
- Server state → TanStack Query
- Client state → Zustand
If you're already on TanStack Query (see our TanStack Query vs SWR comparison) and Zustand (see our Zustand vs Redux breakdown), TanStack Router completes the trio. That cohesion is a real argument, not just marketing.
Decision framework
Choose React Router if:
- You have an existing React Router app and it's working.
- You want the largest ecosystem, hiring pool, and tutorial coverage.
- You're moving toward Remix-style route modules incrementally.
- You want the lowest migration risk from v6.
Choose TanStack Router if:
- You're starting a new TypeScript-first app.
- Search params are load-bearing product logic (dashboards, filters, shareable views).
- You're already using TanStack Query.
- You want route definitions and navigation to be type-checked end to end.
If you're genuinely unsure: React Router v7. It's the lower-risk choice, and if you later decide TanStack Router fits better, the migration cost is the same whether you do it now or in a year.
Wrapping up
React Router is still the mainstream choice in 2026, and it earned that position over a decade. TanStack Router has captured roughly 40% of its volume in two and a half years, and in new repos the gap is much narrower than the headline downloads suggest.
The decision isn't about which library is "better." It's about whether type-safe routing and first-class search params solve a problem you actually have. If your routing bugs are type bugs, TanStack Router pays for itself. If your app is straightforward and your team already knows React Router, staying is the right call.
For the rest of the stack, see our TanStack Query vs SWR and Zustand vs Redux comparisons. If you're choosing the build tool underneath, our Webpack vs Vite guide covers that.
Frequently asked questions
Is TanStack Router better than React Router?
For new TypeScript-heavy apps with complex URL state, yes. TanStack Router gives you compile-time route checking, typed search params, and tighter integration with TanStack Query. For existing React Router projects and teams that value the largest ecosystem, React Router is still the safer choice.
Will TanStack Router replace React Router?
Not soon. React Router still has 2x–6x the weekly downloads depending on the measurement, and a decade of ecosystem momentum. But in repos created in the last 90 days, TanStack Router's share is roughly three times what it is in older repos, so the gap is narrowing in new projects.
How long does migrating from React Router to TanStack Router take?
For a mid-sized app, budget two to four weeks. Every route definition, <Link>, useParams call, and navigation has to be rewritten. The migration is a routing-layer rewrite, not a mechanical find-and-replace. For a large codebase, budget more.
What are TanStack Router's main advantages over React Router?
Three: compile-time type safety for routes and params (navigating to a nonexistent route is a type error), first-class search params with schema validation and serialization built in, and loaders that integrate with TanStack Query to eliminate loading waterfalls.
What does React Router do better?
Ecosystem size, hiring pool, tutorial coverage, and migration path from v6. React Router v7 also absorbed Remix and supports route modules, loaders, and actions incrementally, which is a better fit for teams moving toward a full-stack Remix-style model.
Is TanStack Router's bundle size smaller?
Yes. Roughly 40.2 KB min+gz vs React Router v7's ~58.4 KB. About 30% smaller. Neither is large enough to be the sole deciding factor, but it's a real advantage if you're optimizing bundle size.
Do I need TanStack Query to use TanStack Router?
No, but the two are designed to work together. TanStack Router's loaders can prefetch with TanStack Query, which eliminates loading waterfalls. If you're already on TanStack Query, TanStack Router feels unusually cohesive. If you're not, you can still use TanStack Router on its own.
Should I migrate if my React Router app works?
Probably not. The migration is a routing-layer rewrite, and a working app is a legitimate reason to stay. Migrate if you're starting fresh, rewriting routing anyway, or if your routing bugs are consistently type bugs that TanStack's compile-time checking would have caught.
Which is better for AI-assisted development?
TanStack Router has an edge in 2026 because its full type safety acts as a guardrail — an AI agent that writes a broken route gets a compile error instead of a runtime 404. TanStack's docs also ship an llms.txt file, which React Router's don't. That's a real consideration if AI-assisted coding is part of your workflow.
Does TanStack Router support file-based routing?
Yes. It supports both code-based and file-based route definitions, with full TypeScript inference in both modes. If you want file-based routing without giving up strong type inference, TanStack Router has the more ambitious implementation.
Need help choosing a router or migrating a large app to TanStack Router without breaking existing URLs? Red Surge Technology builds maintainable React architectures. Get in touch to discuss your project.