React routing libraries

Updated Nov 2026

React routing libraries match the browser URL to the components a React app renders. A router maps each path to a route component and can load that route's data before it renders. These libraries let single-page apps and server-rendered sites keep navigation in sync with browser history.

Popularity

next has the most monthly downloads in this comparison, at 362.1M, a count that covers every Next.js app.

LibraryMonthly downloadsStarsLast releaseLicense
next
362.1M
143.7KNov 2026MIT
react-router
294.3M
56.6KOct 2026MIT
@tanstack/react-router
95.0M
15.3KOct 2026MIT
wouter
10.7M
7.9KSep 2026Unlicense
Remix
3.2M
33.5KJun 2026MIT
@reach/router
1.8M
6.8KJun 2020MIT
gatsby
1.2M
55.9KFeb 2026MIT
react-router5
42.8K
1.7KMar 2020MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Defines React application routes through files, shared layouts, and server-rendered page components.

Downloads / mo
362.1M
Stars
143.7K
Last release
16.4.6
License
MIT

Strengths

  • Preserves layouts between pages. Keep shared layouts interactive while navigating between their pages.
  • Fetches data in server components. Load page data directly through fetch or a database client.

Limitations

  • Static search hooks need Suspense. Wrap useSearchParams in Suspense when the page is statically rendered.
  • Refresh preserves server-side cached data. Use revalidatePath or revalidateTag when cached server data must change.
$ npx create-next-app@16.4.6 routing-demo --yes
import Link from 'next/link';

export default function Page() {
  return <Link href='/about'>About</Link>;
}

next examples

From open-source projects on GitHub

Matches URLs to React interfaces, with optional data routing and a full framework mode.

Downloads / mo
294.3M
Stars
56.6K
Last release
8.5.1
License
MIT

Strengths

  • Chooses routing features by mode. Start with declarative routing or add data loading and framework tooling.
  • Loads data alongside route navigation. Use loaders, actions, and pending states in Data Mode.

Limitations

  • Declarative mode excludes data APIs. Choose Data or Framework Mode for loaders, actions, and fetchers.
  • Parent authentication leaves child gaps. Protect each loader and action, or use appropriate server middleware.

Quickstart

From installation.md
$ npm install react-router react@^19.2.7 react-dom@^19.2.7 @types/react@^19.2.0 @types/react-dom@^19.2.0
import { createRoot } from 'react-dom/client';
import { BrowserRouter, Routes, Route } from 'react-router';

createRoot(document.getElementById('root')!).render(
  <BrowserRouter>
    <Routes><Route path='/' element={<h1>Home</h1>} /></Routes>
  </BrowserRouter>
);

react-router examples

From open-source projects on GitHub

@tanstack/react-router

Provides typed React navigation, nested route trees, and cached per-route data loaders.

Downloads / mo
95.0M
Stars
15.3K
Last release
1.170.46
License
MIT

Strengths

  • Infers types throughout routing. Carry path, search, and context types through navigation and route hooks.
  • Caches and preloads route data. Reuse route-loader data with built-in stale-while-revalidate caching.

Limitations

  • Loader caches stay route-specific. Add a shared data cache when routes need deduplicated records.
  • Server navigation calls do nothing. Use the redirect API to redirect a server-rendered request.

Quickstart

From main.tsx
$ npm install @tanstack/react-router react react-dom
import { createRoot } from 'react-dom/client';
import { createRootRoute, createRoute, createRouter, Outlet, RouterProvider } from '@tanstack/react-router';

const rootRoute = createRootRoute({ component: () => <Outlet /> });
const homeRoute = createRoute({ getParentRoute: () => rootRoute, path: '/', component: () => <h1>Home</h1> });
const router = createRouter({ routeTree: rootRoute.addChildren([homeRoute]) });
createRoot(document.getElementById('root')!).render(<RouterProvider router={router} />);

Provides hook-based location control and component-based routing for React and Preact applications.

Downloads / mo
10.7M
Stars
7.9K
Last release
3.13.0
License
Unlicense

Strengths

  • Uses hooks or route components. Choose direct location control or component-based matching for the interface.
  • Nests routes with relative locations. Enable nest to give child routes locations relative to their parent.

Limitations

  • Reads the nearest route parameters. Read useParams within the route that owns the needed parameter.
  • Server rendering needs explicit location. Wrap the server-rendered application in Router with the request path.

Quickstart

From README.md
$ npm install wouter react react-dom
import { useLocation } from 'wouter';

export default function Location() {
  const [location] = useLocation();
  return <p>{location}</p>;
}

wouter examples

From open-source projects on GitHub

Provides React DOM bindings for Remix.

Downloads / mo
3.2M
Stars
33.5K
Last release
2.17.5
License
MIT

Quickstart

From README.md
$ npx create-remix@2.17.5 routing-demo
import { Link } from '@remix-run/react';

export default function Index() {
  return <Link to='/about'>About</Link>;
}

Remix examples

From open-source projects on GitHub

Provides routing for React.

Downloads / mo
1.8M
Stars
6.8K
Last release
1.3.4
License
MIT

Quickstart

From Router.md
$ npm install @reach/router react@16 react-dom@16
import { Router } from '@reach/router';

function Home(_props: { path?: string }) { return <h1>Home</h1>; }
export default function App() { return <Router><Home path='/' /></Router>; }

@reach/router examples

From open-source projects on GitHub

Generates sites with React.

Downloads / mo
1.2M
Stars
55.9K
Last release
5.16.1
License
MIT

Quickstart

From README.md
$ npm install gatsby react react-dom
import { Link } from 'gatsby';

export default function Home() {
  return <Link to='/about'>About</Link>;
}

gatsby examples

From open-source projects on GitHub

Provides router5 helpers for React.

Downloads / mo
42.8K
Stars
1.7K
Last release
8.0.1
License
MIT

Quickstart

From README.md
$ npm install react-router5 router5 router5-plugin-browser react react-dom
import { createRoot } from 'react-dom/client';
import createRouter from 'router5';
import browserPlugin from 'router5-plugin-browser';
import { RouterProvider, Link } from 'react-router5';

const router = createRouter([{ name: 'home', path: '/' }]);
router.usePlugin(browserPlugin());
router.start();
createRoot(document.getElementById('root')!).render(
  <RouterProvider router={router}><Link routeName='home'>Home</Link></RouterProvider>
);

react-router5 examples

From open-source projects on GitHub

FAQ

react-router suits apps that start with declarative routing and add data loading later. @tanstack/react-router suits apps that want typed paths, search parameters, and cached route data. wouter suits small apps that route through hooks or route components.

react-router matches URLs to React interfaces, with optional data routing and a full framework mode. Its loaders and actions run in Data Mode.

@tanstack/react-router provides typed React navigation, nested route trees, and cached per-route data loaders.

react-router suits apps that choose features by mode, from declarative routing to a full framework. @tanstack/react-router suits apps that want types inferred through every route and built-in stale-while-revalidate caching.

wouter provides hook-based location control and component-based routing for React and Preact applications.

For coding agents

Found your routing library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official