Skip to content

React Router

React Router scores 15 of 28 points. That is 8 of 14 on the 7 features that affect first paint (the moment the browser first draws content), and 7 of 14 on the 7 other features.

Tied for rank 14 of 23 with SolidStart, Void (React), Void (Vue), Void (Solid)15/28 points: 8/14 first-paint, 7/14 other · 54% complete
Version checked
react-router / @react-router/dev 8.5.1 (the port's locked version; npm latest is 8.5.2, a patch release of 2026-11-18)
Version notes
Framework mode is the Remix successor, formerly "React Router v7"; reactrouter.com docs now default to v8 (7.18.x still maintained).
Performance guide
Automatic Code Splitting | React RouterNo dedicated performance page; closest official page.
Issues
github.com/remix-run/react-router/issues

Scorecard

All 14 features, in two groups. Each row shows React Router's label, how that label compares across all 23 frameworks, and how to enable the feature. Feature names link to React Router's entry on that feature's page.

React Router's labels across 14 features

  • 1st-party5
  • Experimental1
  • Third-party4
  • Manual4
  • of 14

How it compares

On 5 of 14 features, no framework has a higher-scoring label than React Router. On the other 9, at least one does.

Tested in our port

The react-router-books port passes 11/11 feature tests. Run on 2026-11-26 at MaxwellCohen/react-router-books@d91ca5c. How we test labels

First-paint levers

8/14
  • Manual, like 11 of the other 22 frameworks. 11 frameworks score higher.

    Show the how-to

    No first-party CSS inlining documented; CSS is Vite's story (side-effect imports, links export with ?url, React 19 <link precedence>). Inline by hand, e.g. ?inline. (styling)

    Code example

    Import the stylesheet with Vite's ?inline query instead of the port's ?url, and render it in a <style> in the root Layout. The string also ships in the client bundle, so keep it small.

    // app/root.tsx
    import appCss from './styles/global.css?inline'
    // …
    export const links: Route.LinksFunction = () => [
      { rel: 'icon', href: '/icon.svg', type: 'image/svg+xml' },
      // no { rel: 'stylesheet' } entry: the CSS is inlined below
    ]
    
    export function Layout({ children }: { children: React.ReactNode }) {
      return (
        <html lang="en">
          <head>
            <Meta />
            <Links />
            <style dangerouslySetInnerHTML={{ __html: appCss }} />
          </head>
          {/* … */}
        </html>
      )
    }

    Source: Vite: disabling CSS injection

  • 02Font optimizationThird-party1 pt

    Third-party, like 18 of the other 22 frameworks. 4 frameworks score higher.

    Show the how-to

    No first-party font primitive documented; the styling page does not cover fonts (use Fontsource or a CDN by hand). (styling)

    Code example

    The port installs Fontsource's variable Geist packages and imports them at the top of the global stylesheet. The packages ship the @font-face rules and self-hosted font files, and Vite bundles them like any other CSS import.

    /* app/styles/global.css */
    @import '@fontsource-variable/geist';
    @import '@fontsource-variable/geist-mono';
    @import 'tailwindcss';
    
    @theme {
      /* … */
      --font-geist-sans: 'Geist Variable', 'Geist', ui-sans-serif, system-ui, sans-serif;
      --font-geist-mono: 'Geist Mono Variable', 'Geist Mono', ui-monospace, monospace;
      --font-sans: var(--font-geist-sans);
      --font-mono: var(--font-geist-mono);
    }

    Source: Fontsource: Installing fonts

  • 03Image pipelineThird-party1 pt

    Third-party, like 13 of the other 22 frameworks. 9 frameworks score higher.

    Show the how-to

    No first-party image component or optimizer documented (only a ?url asset import is shown); use a community package such as @unpic/react or a host image CDN by hand. (styling)

    Code example

    Install @unpic/react and render its <Image> in place of <img>. When it recognizes the image CDN in the URL, it writes a responsive srcset that asks the CDN for each width. It also sets sizes, dimensions and lazy loading.

    // app/features/book/components/book-cover.tsx
    import { Image } from '@unpic/react'
    
    export function BookCover({ src, title }: { src: string; title: string }) {
      return (
        <Image
          src={src}
          layout="constrained"
          width={300}
          height={450}
          alt={title}
        />
      )
    }

    Source: Unpic: @unpic/react

    Art direction with <picture>

    Manual

    Serving a different crop or format per screen size. Not scored: the label shows how much the framework does for you.

    No first-party <picture> helper documented; hand-write the markup. (styling)

    Example

    There is no image component, so write <picture> in a route or component, with files served from public/. React spells the attribute srcSet.

    // app/features/home/hero-image.tsx
    export function HeroImage() {
      return (
        <picture>
          {/* art direction: a square crop on narrow screens */}
          <source media="(max-width: 640px)" type="image/avif"
                  srcSet="/media/hero-square-640.avif" width={640} height={640} />
          {/* format fallback: AVIF, then WebP, then the <img> JPEG */}
          <source type="image/avif" sizes="100vw"
                  srcSet="/media/hero-1280.avif 1280w, /media/hero-1920.avif 1920w" />
          <source type="image/webp" sizes="100vw"
                  srcSet="/media/hero-1280.webp 1280w, /media/hero-1920.webp 1920w" />
          <img src="/media/hero-1280.jpg" alt="Shelves of books" width={1280} height={720}
               fetchPriority="high" decoding="async" />
        </picture>
      )
    }

    Source: MDN: the picture element

  • 04Data/HTML caching1st-party2 pts

    1st-party, like 16 of the other 22 frameworks. None scores higher.

    Show the how-to

    Route headers export sets Cache-Control (deepest route wins; parentHeaders merges). prerender config is build-time only, with no ISR/revalidate option. Vercel's docs show s-maxage=1, stale-while-revalidate=59 via headers. (headers, pre-rendering, react-router)

    Code example

    Export headers from a route module to set Cache-Control on that route's document response. A child route can read parentHeaders and overwrite one value.

    // app/routes/book.tsx
    import type { Route } from './+types/book'
    
    export function headers({ parentHeaders }: Route.HeadersArgs) {
      parentHeaders.set(
        'Cache-Control',
        'max-age=3600, s-maxage=86400',
      )
      return parentHeaders
    }

    Source: React Router: HTTP Headers

  • 05Route prefetching1st-party2 pts

    1st-party, like 18 of the other 22 frameworks. None scores higher.

    Show the how-to

    <Link prefetch="none|intent|render|viewport">, default none, uses <link rel="prefetch">. Lazy route discovery is on by default and batch-discovers rendered links; discover="none" opts out. (Link, lazy-route-discovery, react-router.config.ts)

    Code example

    Set prefetch on <Link>. "intent" loads the route module and data on hover or focus, "viewport" when the link scrolls into view, and "render" as soon as it renders. The port wraps <Link> in its own FastLink.

    // app/components/ui/fast-link.tsx
    import { Link } from 'react-router'
    // …
    export function FastLink({ href, prefetch = 'intent', ...rest }: Props) {
      return (
        <Link
          prefetch={prefetch === false ? 'none' : prefetch === true ? 'intent' : prefetch}
          to={href}
          {...rest}
        />
      )
    }

    Source: React Router: Link

  • 06Streaming SSR1st-party2 pts

    1st-party, like 17 of the other 22 frameworks. None scores higher.

    Show the how-to

    Return a promise from a loader without awaiting it, then render it with <Await resolve={...}> inside <Suspense>; the awaited data renders first and the rest streams in. The loader must return an object with keys, not a single promise. (suspense)

    Code example

    The loader awaits the critical data and returns the slow promise as-is. The component renders that promise with <Await> inside <Suspense>, so the fallback goes out first.

    // app/routes/book.tsx
    import { Suspense } from 'react'
    import { Await } from 'react-router'
    import type { Route } from './+types/book'
    
    export async function loader({ params }: Route.LoaderArgs) {
      const reviews = getReviews(params.id) // NOT awaited
      const book = await getBook(params.id)
      return { book, reviews }
    }
    
    export default function Book({ loaderData }: Route.ComponentProps) {
      return (
        <>
          <h1>{loaderData.book.title}</h1>
          <Suspense fallback={<p>Loading reviews…</p>}>
            <Await resolve={loaderData.reviews}>
              {(reviews) => <ul>{reviews.map((r) => <li key={r.id}>{r.text}</li>)}</ul>}
            </Await>
          </Suspense>
        </>
      )
    }

    Source: React Router: Streaming with Suspense

  • Manual, like 15 of the other 22 frameworks. 7 frameworks score higher.

    Show the how-to

    No first-party preload Link headers or 103 Early Hints documented. The route headers export can set a Link header by hand, with the asset URLs listed by the app. (headers)

    Code example

    Export headers from a route module and return a Link header. This one preconnects to the font host. To preload a built file with a hashed name, read its URL from the Vite manifest.

    // app/routes/home.tsx
    export function headers() {
      return { Link: '<https://fonts.gstatic.com>; rel=preconnect; crossorigin' };
    }

    Source: React Router: HTTP headers

Other features

7/14
  • Experimental, like 4 of the other 22 frameworks. 15 frameworks score higher.

    Show the how-to

    Experimental RSC (React 19+): unstable_reactRouterRSC from @react-router/dev/vite plus experimental @vitejs/plugin-rsc; unstable_-prefixed and still unstable in 8.5.2. No islands or partial-hydration primitive documented. splitRouteModules only splits client exports. (react-server-components, code-splitting)

    Code example

    Swap reactRouter() for the unstable RSC plugin and add @vitejs/plugin-rsc after it. Route modules then render as React Server Components, and only 'use client' modules ship JavaScript.

    // vite.config.ts
    import { defineConfig } from 'vite'
    import { unstable_reactRouterRSC as reactRouterRSC } from '@react-router/dev/vite'
    import rsc from '@vitejs/plugin-rsc'
    
    export default defineConfig({
      plugins: [reactRouterRSC(), rsc()],
    })

    Source: React Router: React Server Components

  • 1st-party, like 18 of the other 22 frameworks. None scores higher.

    Show the how-to

    prerender (stable config) takes a per-URL list, so listed paths are static while the rest are server-rendered (ssr: true) or served from the SPA fallback (ssr: false); clientLoader skips server data per route. ssr itself is global, with no per-route export; ssr: "unstable_api-only" is experimental (v8.5.0). (rendering, pre-rendering, spa)

    Code example

    List the URLs to prerender at build time. Those paths become static HTML, and every other path is server-rendered because ssr stays true.

    // react-router.config.ts
    import type { Config } from '@react-router/dev/config'
    
    export default {
      // Can be omitted - defaults to true
      ssr: true,
      prerender: ['/', '/blog', '/blog/popular-post'],
    } satisfies Config

    Source: React Router: Pre-Rendering

  • 1st-party, like 21 of the other 22 frameworks. None scores higher.

    Show the how-to

    React-based; the first-party React Compiler is added as a Babel preset to the React Vite plugin (not enabled in this port). v8.4.0 also split internal router contexts to reduce router re-renders. (react-compiler, changelog)

    Code example

    Add the React Compiler's Babel plugin next to reactRouter(). The compiler memoizes components and hooks at build time, so fewer components re-render when state changes.

    // vite.config.ts
    import { defineConfig } from 'vite'
    import babel from 'vite-plugin-babel'
    import { reactRouter } from '@react-router/dev/vite'
    
    export default defineConfig({
      plugins: [
        reactRouter(),
        babel({
          filter: /\.[jt]sx?$/,
          babelConfig: {
            presets: ['@babel/preset-typescript'],
            plugins: [['babel-plugin-react-compiler', {}]],
          },
        }),
      ],
    })

    Source: React: React Compiler installation

  • Third-party, like 18 of the other 22 frameworks. 2 frameworks score higher.

    Show the how-to

    No first-party analyzer documented; the code-splitting page does not mention one; the third-party route is a community Vite/Rollup visualizer such as rollup-plugin-visualizer, added by hand. No React Router page recommends one. (code-splitting)

    Code example

    Add rollup-plugin-visualizer to the Vite config. react-router build then writes a treemap of the client bundle to stats.html.

    // vite.config.ts
    import { reactRouter } from '@react-router/dev/vite'
    import tailwindcss from '@tailwindcss/vite'
    import { visualizer } from 'rollup-plugin-visualizer'
    import { defineConfig } from 'vite'
    
    export default defineConfig({
      plugins: [
        tailwindcss(),
        reactRouter(),
        visualizer({ filename: 'stats.html', gzipSize: true }),
      ],
    })

    Source: rollup-plugin-visualizer: README

  • Manual, like 16 of the other 22 frameworks. 6 frameworks score higher.

    Show the how-to

    No first-party strategy documented; <Scripts> renders the app runtime and only spreads attributes (crossOrigin, nonce), with no async/defer strategy documented. (Scripts)

    Code example

    <Scripts /> only renders the app runtime, so write the tags yourself: async in Layout for early scripts, or inject in a useEffect after hydration.

    // app/root.tsx
    import { useEffect } from 'react'
    // …
    export function Layout({ children }: { children: React.ReactNode }) {
      return (
        <html lang="en">
          <head>
            {/* … */}
            {/* React 19 hoists and de-duplicates <script async src> */}
            <script async src="https://plausible.io/js/script.js" data-domain="books.example" />
          </head>
          {/* … */}
        </html>
      )
    }
    
    export default function App() {
      useEffect(() => {
        // Client only, after hydration: load the chat widget when the browser is idle.
        ;(window.requestIdleCallback ?? setTimeout)(() => {
          const s = document.createElement('script')
          s.src = 'https://widget.example.com/chat.js'
          s.async = true
          document.body.append(s)
        })
      }, [])
      // …
    }

    Source: React: the script component

  • Third-party, like 5 of the other 22 frameworks. 8 frameworks score higher.

    Show the how-to

    React Router-maintained adapters: @react-router/serve and @react-router/express (Node), @react-router/cloudflare, and @react-router/architect (AWS); v8 removed the Cloudflare dev proxy in favor of @cloudflare/vite-plugin. Vercel (@vercel/react-router preset) and Netlify (@netlify/vite-plugin-react-router) are host-maintained, not React Router-owned, so two of the four hosts this repo targets rely on host packages. (adapter, deploying, react-router, react-router, react-router)

    Code example

    The port picks a host plugin from environment variables at build time. Cloudflare uses @cloudflare/vite-plugin, Netlify uses its own React Router plugin, and Vercel uses the vercelPreset() in react-router.config.ts.

    // vite.config.ts
    import { reactRouter } from '@react-router/dev/vite'
    import { cloudflare } from '@cloudflare/vite-plugin'
    import netlifyReactRouter from '@netlify/vite-plugin-react-router'
    import { defineConfig, type PluginOption } from 'vite'
    
    const env = process.env
    const isCloudflare = !!(env.CLOUDFLARE || env.WORKERS_CI || env.CF_PAGES)
    const isNetlify = !!env.NETLIFY && !isCloudflare
    
    const hostPlugins: PluginOption[] = isCloudflare
      ? [cloudflare({ viteEnvironment: { name: 'ssr' } })]
      : isNetlify
        ? [netlifyReactRouter()]
        : []
    
    export default defineConfig({
      plugins: [...hostPlugins, reactRouter()],
    })

    Source: React Router: Deploying

  • Manual, like 16 of the other 22 frameworks. 6 frameworks score higher.

    Show the how-to

    No service worker support documented. The community @vite-pwa/remix package (0.2.0, published 2025-03-30) targets Remix and does not state React Router v8 support, so it is not credited. Hand-write the worker in public/ and register it. (vite-pwa remix)

    Code example

    Put a hand-written worker in public/ and register it with an inline script in the root route.

    // public/sw.js
    const CACHE = 'books-v1'; // change the name on each deploy
    
    self.addEventListener('activate', (event) => {
      event.waitUntil(
        caches.keys().then((keys) => Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))),
      );
    });
    
    self.addEventListener('fetch', (event) => {
      const { request } = event;
      if (request.method !== 'GET' || new URL(request.url).origin !== location.origin) return;
      // Network first, so pages stay current. The cached copy answers when offline.
      event.respondWith(
        fetch(request)
          .then((response) => {
            const copy = response.clone();
            caches.open(CACHE).then((cache) => cache.put(request, copy));
            return response;
          })
          .catch(() => caches.match(request)),
      );
    });
    // app/root.tsx
    const swScript = `if('serviceWorker' in navigator)addEventListener('load',function(){navigator.serviceWorker.register('/sw.js')});`;
    // … in <head>
            <script dangerouslySetInnerHTML={{ __html: swScript }} />

    Source: Using Service Workers (MDN)

1st-party scores 2 points, Experimental and Third-party 1, Manual 0. How scoring works

The port

The books demo app built with this framework, and where each branch is deployed.

Latest benchmark

Mobile Lighthouse lab results from PageSpeed Insights on : the median of 3 runs per host, averaged across the hosts listed. The benchmark page explains each metric and has every other framework.

React Router: latest benchmark per build and page
BuildPathPerfFCPRaw FCPLCPTBTCLSSITTIDocHosts
Book list /
baseline/83(good)1.510.64(poor)4.61(good)5(good)0.0011.834.611363/3 Vercel, Netlify, Cloudflare
optimized/85(good)0.911.65(poor)4.21(good)10(good)0.0002.904.211523/3 Vercel, Netlify, Cloudflare
Book page /10145787
baseline/1014578794(good)1.521.34(needs improvement)2.97(good)3(good)0.0002.492.971583/3 Vercel, Netlify, Cloudflare
optimized/1014578797(good)0.910.96(needs improvement)2.52(good)5(good)0.0001.942.531163/3 Vercel, Netlify, Cloudflare
  • Good
  • Needs improvement
  • Poor

FCP 1.8 s / 3 s · LCP 2.5 s / 4 s · TBT 200 ms / 600 ms · CLS 0.1 / 0.25

Per host

The medians above before averaging. Runs is how many measured runs went into each median. Host names link to the deployment.

React Router: latest benchmark per build, page and host
BuildPathHostPerfFCPRaw FCPLCPTBTCLSSITTIDocRunsStatus
React Router
baseline/Vercel83(good)1.510.28(poor)4.66(good)0(good)0.0001.514.661033/3OK
baseline/Netlify85(good)1.510.31(poor)4.36(good)15(good)0.0031.514.361183/3OK
baseline/Cloudflare82(good)1.511.34(poor)4.80(good)0(good)0.0002.484.801873/3OK
baseline/10145787Vercel94(good)1.511.33(needs improvement)3.02(good)0(good)0.0002.473.021593/3OK
baseline/10145787Netlify95(good)1.511.35(needs improvement)2.88(good)9(good)0.0002.502.881663/3OK
baseline/10145787Cloudflare94(good)1.541.33(needs improvement)3.02(good)0(good)0.0002.493.021493/3OK
optimized/Vercel86(good)0.911.28(poor)4.21(good)0(good)0.0002.494.211433/3OK
optimized/Netlify84(good)0.912.35(poor)4.21(good)30(good)0.0004.014.211873/3OK
optimized/Cloudflare85(good)0.911.30(poor)4.21(good)0(good)0.0002.194.211253/3OK
optimized/10145787Vercel98(good)0.910.31(good)2.41(good)0(good)0.0000.912.41803/3OK
optimized/10145787Netlify95(good)0.932.32(needs improvement)2.60(good)16(good)0.0004.002.601493/3OK
optimized/10145787Cloudflare97(good)0.910.27(needs improvement)2.56(good)0(good)0.0000.912.561203/3OK