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.
- 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
- 01Production CSS inliningManual0 pts
Manual, like 11 of the other 22 frameworks. 11 frameworks score higher.
Show the how-toHide the how-to
No first-party CSS inlining documented; CSS is Vite's story (side-effect imports,
linksexport with?url, React 19<link precedence>). Inline by hand, e.g.?inline. (styling)Code example
Import the stylesheet with Vite's
?inlinequery instead of the port's?url, and render it in a<style>in the rootLayout. 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-toHide 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-facerules 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-toHide the how-to
No first-party image component or optimizer documented (only a
?urlasset import is shown); use a community package such as@unpic/reactor a host image CDN by hand. (styling)Code example
Install
@unpic/reactand render its<Image>in place of<img>. When it recognizes the image CDN in the URL, it writes a responsivesrcsetthat asks the CDN for each width. It also setssizes, 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>
ManualServing 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 frompublic/. React spells the attributesrcSet.// 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-toHide the how-to
Route
headersexport setsCache-Control(deepest route wins;parentHeadersmerges).prerenderconfig is build-time only, with no ISR/revalidate option. Vercel's docs shows-maxage=1, stale-while-revalidate=59viaheaders. (headers, pre-rendering, react-router)Code example
Export
headersfrom a route module to setCache-Controlon that route's document response. A child route can readparentHeadersand 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-toHide the how-to
<Link prefetch="none|intent|render|viewport">, defaultnone, 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
prefetchon<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 ownFastLink.// 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-toHide the how-to
Return a promise from a
loaderwithout 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> </> ) } - 07Early Hints / preload headersManual0 pts
Manual, like 15 of the other 22 frameworks. 7 frameworks score higher.
Show the how-toHide the how-to
No first-party preload
Linkheaders or 103 Early Hints documented. The routeheadersexport can set aLinkheader by hand, with the asset URLs listed by the app. (headers)Code example
Export
headersfrom a route module and return aLinkheader. 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
- 08Islands / partial hydration / lazy slicesExperimental1 pt
Experimental, like 4 of the other 22 frameworks. 15 frameworks score higher.
Show the how-toHide the how-to
Experimental RSC (React 19+):
unstable_reactRouterRSCfrom@react-router/dev/viteplus experimental@vitejs/plugin-rsc;unstable_-prefixed and still unstable in 8.5.2. No islands or partial-hydration primitive documented.splitRouteModulesonly splits client exports. (react-server-components, code-splitting)Code example
Swap
reactRouter()for the unstable RSC plugin and add@vitejs/plugin-rscafter 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()], }) - 09Per-route render modes1st-party2 pts
1st-party, like 18 of the other 22 frameworks. None scores higher.
Show the how-toHide 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);clientLoaderskips server data per route.ssritself 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
ssrstaystrue.// 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 ConfigSource: React Router: Pre-Rendering
- 10Fine-grained client reactivity1st-party2 pts
1st-party, like 21 of the other 22 frameworks. None scores higher.
Show the how-toHide 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', {}]], }, }), ], }) - 11Built-in bundle analysisThird-party1 pt
Third-party, like 18 of the other 22 frameworks. 2 frameworks score higher.
Show the how-toHide 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-visualizerto the Vite config.react-router buildthen writes a treemap of the client bundle tostats.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
- 12Third-party script strategiesManual0 pts
Manual, like 16 of the other 22 frameworks. 6 frameworks score higher.
Show the how-toHide the how-to
No first-party strategy documented;
<Scripts>renders the app runtime and only spreads attributes (crossOrigin,nonce), with noasync/deferstrategy documented. (Scripts)Code example
<Scripts />only renders the app runtime, so write the tags yourself:asyncinLayoutfor early scripts, or inject in auseEffectafter 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
- 13Portable multi-host deploymentThird-party1 pt
Third-party, like 5 of the other 22 frameworks. 8 frameworks score higher.
Show the how-toHide the how-to
React Router-maintained adapters:
@react-router/serveand@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-routerpreset) 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 thevercelPreset()inreact-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
- 14Service worker / offline supportManual0 pts
Manual, like 16 of the other 22 frameworks. 6 frameworks score higher.
Show the how-toHide the how-to
No service worker support documented. The community
@vite-pwa/remixpackage (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 inpublic/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.
- App
- react-router-books
- Repository
- github.com/MaxwellCohen/react-router-books
Branch
main
vibe port
Branch
optimized
cache + fonts
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.
| Build | Path | Perf | FCP | Raw FCP | LCP | TBT | CLS | SI | TTI | Doc | Hosts |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Book list / | |||||||||||
| baseline | / | 83 | (good)1.51 | 0.64 | (poor)4.61 | (good)5 | (good)0.001 | 1.83 | 4.61 | 136 | 3/3 Vercel, Netlify, Cloudflare |
| optimized | / | 85 | (good)0.91 | 1.65 | (poor)4.21 | (good)10 | (good)0.000 | 2.90 | 4.21 | 152 | 3/3 Vercel, Netlify, Cloudflare |
| Book page /10145787 | |||||||||||
| baseline | /10145787 | 94 | (good)1.52 | 1.34 | (needs improvement)2.97 | (good)3 | (good)0.000 | 2.49 | 2.97 | 158 | 3/3 Vercel, Netlify, Cloudflare |
| optimized | /10145787 | 97 | (good)0.91 | 0.96 | (needs improvement)2.52 | (good)5 | (good)0.000 | 1.94 | 2.53 | 116 | 3/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.
| Build | Path | Host | Perf | FCP | Raw FCP | LCP | TBT | CLS | SI | TTI | Doc | Runs | Status |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| React Router | |||||||||||||
| baseline | / | Vercel | 83 | (good)1.51 | 0.28 | (poor)4.66 | (good)0 | (good)0.000 | 1.51 | 4.66 | 103 | 3/3 | OK |
| baseline | / | Netlify | 85 | (good)1.51 | 0.31 | (poor)4.36 | (good)15 | (good)0.003 | 1.51 | 4.36 | 118 | 3/3 | OK |
| baseline | / | Cloudflare | 82 | (good)1.51 | 1.34 | (poor)4.80 | (good)0 | (good)0.000 | 2.48 | 4.80 | 187 | 3/3 | OK |
| baseline | /10145787 | Vercel | 94 | (good)1.51 | 1.33 | (needs improvement)3.02 | (good)0 | (good)0.000 | 2.47 | 3.02 | 159 | 3/3 | OK |
| baseline | /10145787 | Netlify | 95 | (good)1.51 | 1.35 | (needs improvement)2.88 | (good)9 | (good)0.000 | 2.50 | 2.88 | 166 | 3/3 | OK |
| baseline | /10145787 | Cloudflare | 94 | (good)1.54 | 1.33 | (needs improvement)3.02 | (good)0 | (good)0.000 | 2.49 | 3.02 | 149 | 3/3 | OK |
| optimized | / | Vercel | 86 | (good)0.91 | 1.28 | (poor)4.21 | (good)0 | (good)0.000 | 2.49 | 4.21 | 143 | 3/3 | OK |
| optimized | / | Netlify | 84 | (good)0.91 | 2.35 | (poor)4.21 | (good)30 | (good)0.000 | 4.01 | 4.21 | 187 | 3/3 | OK |
| optimized | / | Cloudflare | 85 | (good)0.91 | 1.30 | (poor)4.21 | (good)0 | (good)0.000 | 2.19 | 4.21 | 125 | 3/3 | OK |
| optimized | /10145787 | Vercel | 98 | (good)0.91 | 0.31 | (good)2.41 | (good)0 | (good)0.000 | 0.91 | 2.41 | 80 | 3/3 | OK |
| optimized | /10145787 | Netlify | 95 | (good)0.93 | 2.32 | (needs improvement)2.60 | (good)16 | (good)0.000 | 4.00 | 2.60 | 149 | 3/3 | OK |
| optimized | /10145787 | Cloudflare | 97 | (good)0.91 | 0.27 | (needs improvement)2.56 | (good)0 | (good)0.000 | 0.91 | 2.56 | 120 | 3/3 | OK |