Remix and React Router Framework Tutorial
Learn Remix and React Router Framework step by step: 39 lessons in 9 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Getting Started
- What Is Remix and React Router Framework Mode? Learn what Remix is, how it became React Router v7 framework mode, what full-stack routing gives you, and how a request becomes HTML, with runnable stand-ins.
- Project Setup and Folder Structure Create a React Router v7 (Remix) app, understand every file and npm script in the template, and learn how client and server bundles are split, with runnable stand-ins.
- Root and Entry Files Understand root.tsx, Layout, Links, Meta, Scripts and the optional entry.client and entry.server files in React Router v7 framework mode, with runnable stand-ins.
- Web Fundamentals in Remix: Request, Response, FormData Learn the web platform APIs Remix is built on: URL, URLSearchParams, Request, Response, Headers and FormData, with runnable examples that mirror loaders and actions.
Routes and Nested Layouts
- Routes and Route Modules Learn how routes.ts maps URLs to route modules in React Router v7 framework mode, with route(), index(), layout() and prefix(), plus what a route module can export.
- Nested Routes and Layouts with Outlet Learn nested routes, layout routes, index routes and the Outlet component in React Router v7 framework mode, and how nested UI loads data in parallel, with runnable stand-ins.
- Dynamic Segments, Optional Segments and Splat Routes Learn dynamic URL params, optional segments, splat routes and 404 catch-all routes in React Router v7 framework mode, and how to validate params safely, with runnable stand-ins.
- The Flat Routes Convention: File-Based Routing Learn the flat routes file-naming convention in React Router v7: dots for nesting, $ for params, _index, pathless layouts, trailing underscores and escapes, with a runnable stand-in.
- Links, Navigation and Meta Navigate in React Router v7 framework mode with Link and NavLink, set page titles with the meta export, add stylesheets with links, and show pending navigation state.
- Index, Layout and Pathless Routes Understand index routes, layout routes without a path and optional segments in React Router v7 framework mode, and how to share UI without changing the URL.
Loaders and Data Loading
- Loader Basics Learn how loaders in React Router v7 framework mode fetch data before a route renders, how useLoaderData reads it, and how parallel loading avoids waterfalls.
- Request, Params and Search Params in Loaders Use the Request object, route params and URL search params inside React Router v7 loaders to build search, filtering and pagination that works without JavaScript.
- Typed Loader Data and Route Types See how React Router v7 generates types for params, loader data and component props, how serialization affects types, and how to type shared loader helpers yourself.
- Client Loaders and Hydration Learn when to use clientLoader in React Router v7 framework mode, how HydrateFallback works, how to cache data in the browser, and how SPA mode changes loading.
- Database Access Patterns in Loaders Organize database access for React Router v7 loaders with .server modules, a model layer, parallel queries, DTO mapping and N+1 avoidance, shown with a runnable in-memory stand-in.
Actions and Forms
- Actions Basics Learn how actions in React Router v7 framework mode handle POST, PUT and DELETE requests, read FormData, redirect after success, and trigger automatic revalidation.
- The Form Component and Progressive Enhancement Use the React Router v7 Form component for GET and POST forms, read actionData, show pending state with useNavigation, and keep forms working without JavaScript.
- Validation and Form Errors Validate form data in React Router v7 actions, return field errors with the right status code, show them accessibly, and share a schema between client and server.
- Fetchers and Concurrent Forms Use useFetcher in React Router v7 to submit forms and load data without changing the URL, run many mutations at once, and track each one with its own state.
- Optimistic UI and File Uploads Make interfaces feel instant with optimistic UI from fetcher.formData in React Router v7, roll back on failure, and handle file uploads safely in actions.
Error Handling and Boundaries
- Error Boundaries in Routes Learn how route-level ErrorBoundary exports catch loader, action and render errors, why the nearest boundary wins, and how the rest of the page keeps working.
- Throwing Responses and 404 Pages Use thrown Response objects and the data() helper for 404, 401 and 403 cases, read them with isRouteErrorResponse, and add a catch-all route for unknown URLs.
- Unexpected Errors and Logging Handle real bugs in Remix and React Router: the server handleError hook, logging without leaking secrets, request IDs, safe messages and reporting client errors.
Sessions and Authentication
- Cookies and Sessions Understand HTTP cookies, signing, createCookie and createCookieSessionStorage in Remix and React Router, flash messages, and how a session survives between requests.
- Session Storage Options Compare cookie, in-memory, file and database-backed session storage in Remix and React Router, build a custom createSessionStorage, and expire and rotate sessions.
- Login and Logout Build a login flow in Remix and React Router: a form action, password hashing with scrypt, safe error messages, session creation, redirects, and a logout action.
- Protecting Routes and Authorization Guard routes in Remix and React Router with requireUser helpers, layout loaders, redirects with a return path, role checks and ownership checks in loaders and actions.
- CSRF and Security Secure a Remix or React Router app: CSRF tokens and SameSite cookies, rate limiting, input validation, escaping and XSS, security headers and secrets that stay on the server.
Streaming and Performance
- Streaming with Promises and Suspense Stream slow data in Remix and React Router: return unawaited promises from a loader, show fallbacks with Suspense and Await, handle rejected promises and know when not to stream.
- HTTP Caching and Headers Speed up Remix and React Router apps with HTTP caching: export headers, set Cache-Control and stale-while-revalidate, use ETag and 304 responses, and avoid caching private pages.
- Prefetching and Pending UI Make navigation feel instant in Remix and React Router: prefetch with the Link prefetch prop, show progress with useNavigation, build optimistic UI with fetchers, and avoid layout jumps.
- Bundle Size and Performance Make Remix and React Router apps fast: route-based code splitting, server-only modules, trimming loader data, parallel data fetching, image handling and measuring Core Web Vitals.
Testing and Deployment
- Testing Loaders and Actions Unit test Remix and React Router loaders and actions as plain functions: build Request objects, assert on data, status and redirects, fake the database and cookies, with Vitest examples.
- Testing Routes and Components with Stubs Test components that use loaders, links and forms with createRoutesStub, Testing Library and Playwright for end-to-end checks, plus when to use each kind of test.
- Building and Deploying Your App Build and deploy a React Router framework app: react-router build, the Node server and Dockerfile, serverless and edge targets, environment variables, health checks and a release checklist.
Projects and Practice
- Project: A Private Notes App Build a small private notes app with Remix and React Router: routes, loaders, actions, validation, sessions, ownership checks and error boundaries, with a runnable model of the whole flow.
- Project: A Blog with an Admin Area Build a blog with Remix and React Router: cacheable public pages, SEO meta tags, an admin area behind a role check, draft and publish, a sitemap and a streamed comments section.
- Practice Exercises Practice error boundaries, sessions, guards, caching and tests in Remix and React Router with six runnable exercises, each with a starter, checks and a worked solution.
- Interview Questions and Answers Prepare for Remix and React Router framework interviews: loaders, actions, errors, sessions, caching, streaming, testing and deployment, with short answers, pitfalls and a self-test.