Remix is a full-stack web framework built on React Router v7 that emphasizes web standards, progressive enhancement, and server-side rendering. React Router v7 unifies Remix and React Router into a single package with three modes: Declarative (basic routing), Data (loaders/actions via createBrowserRouter), and Framework (full-stack with Vite plugin). Unlike traditional SPAs, Remix encourages nested routing, server-first data loading, and form-based mutations that work before JavaScript loads, ensuring resilient user experiences. The framework handles automatic revalidation after mutations, supports streaming SSR with Suspense, and offers type-safe data flow between server and clientβmaking it particularly strong for SEO-critical apps, content-heavy sites, and applications demanding fast perceived performance.
What This Cheat Sheet Covers
This topic spans 14 focused tables and 120 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Route Configuration and File-Based Routing
File-based routing in Remix converts your file structure into URL paths automatically, while React Router v7 supports both file-based and programmatic route configuration. Understanding dynamic segments, splat routes, and optional parameters enables flexible URL patterns without complex regex or manual matching.
| Pattern | Example | Description |
|---|---|---|
app/routes/posts.$postId.tsx/posts/123 β params.postId = "123" | β’ Prefixed with $ β matches any value in that URL segmentβ’ accessible via useParams() hook or loader/action params argument | |
app/routes/dashboard.settings.tsxRenders inside dashboard.tsx's <Outlet /> | β’ Dot separates parent/child β child route renders within parent's <Outlet />β’ automatic parent layout wrapping | |
app/routes/dashboard._index.tsxMatches /dashboard exactly | β’ _index.tsx suffix β renders when parent route matches without additional path segmentsβ’ prevents blank outlet area | |
app/routes/files.$.tsx/files/docs/guide.pdf β params["*"] = "docs/guide.pdf" | β’ $.tsx or $.*tsx β matches remaining URL path including slashesβ’ useful for file browsers, proxies, 404 catchalls | |
app/routes/($lang)._index.tsxMatches / and /en | β’ Parentheses make segment optional β route matches with or without that segment β’ use for i18n paths that can be omitted |