React Router Framework Mode (Remix)
Web-standards-first full-stack React with loaders, actions and nested routes; the evolution of Remix.
Intermediate · about 10 hours · difficulty 4/5
Learn first: CSR, SSR, SSG, ISR and Streaming, Client-Side Routing
Remix merged into React Router, which now has a "framework mode" that provides server rendering, data loading and mutations around nested routes. Its philosophy is to lean on web standards: Request, Response, FormData and plain HTML forms.
Core ideas
- Route modules: each route file exports a component plus optional
loader(read data on the server before rendering),action(handle form submissions and mutations),meta,headersand anErrorBoundary. - Nested routes load their data in parallel, avoiding request waterfalls.
- Forms:
<Form method="post">submits to the route's action. After an action completes, loaders revalidate automatically, so the UI stays in sync without manual cache invalidation. - Progressive enhancement: forms and links work before JavaScript loads, then get enhanced into SPA-style transitions.
useFetcherfor mutations that do not navigate (like buttons in a list), anduseNavigationfor pending UI.- Rendering can be SSR, static prerendering or SPA mode, per app.
- Deploys to Node, serverless and edge runtimes through adapters.
When to choose it
Teams that value web fundamentals, simple mental models for data (loader in, action out), and portability across hosts. If you already know React Router in library mode, the step up is small.
Pitfalls
Doing client-side fetching in effects out of habit instead of using loaders; forgetting to validate and authorise inside actions; confusing library mode and framework mode documentation.
Good enough to move on
You can build a CRUD app with nested routes, loaders, actions with validation, optimistic UI via fetchers and per-route error boundaries.
Key concepts
- Route modules
- Loaders
- Actions and Form
- Automatic revalidation
- useFetcher and pending UI
- Progressive enhancement
- Error boundaries per route
Other options for this step
- Next.js: The leading React framework: App Router, layouts, Server Components, data fetching and caching, Server Actions and middleware.
- Nuxt: The full-stack framework for Vue: file-based routing, SSR and SSG, auto-imports, data fetching and server routes.
- Astro: A content-first framework that ships zero JavaScript by default and hydrates interactive islands built with any UI library.
- SvelteKit: The official Svelte application framework with file-based routing, load functions, form actions and flexible rendering.
Mini project
Build a contacts manager with nested list and detail routes, a create/edit form using actions and Zod validation, optimistic favourite toggles with useFetcher, and a per-route error boundary.
Check yourself
After a successful action, why does the list update without you calling any cache invalidation function?
Free resources
- React Router Framework Mode (React Router)
- React Router Documentation (React Router)