Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 39 ยท 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.

Remix is a full-stack web framework built on React. Instead of shipping an empty page and fetching everything in the browser, it renders pages on the server, ties data loading and form handling to the URL, and then makes the page interactive in the browser. It leans on the web platform: Request, Response, FormData, HTML forms and links.

Remix started as a framework from the creators of React Router. In 2024 its ideas were merged back into React Router itself. Today the same features live in React Router v7 as framework mode. Remix v2 apps upgrade to React Router v7 with very few changes, and most of what you learn in this track applies to both. This course uses the React Router v7 names (react-router, Route.LoaderArgs) and points out the old Remix names where they differ.

The real framework needs Node.js, Vite and a build step, so it cannot run inside this page. Real code is shown in read-only blocks. Every runnable example is a small stand-in written in plain JavaScript that imitates one idea, and each one says what it imitates.

The problem Remix solves

A classic single-page app (SPA) loads in three steps: download JavaScript, run it, then fetch data. The user stares at a spinner for all of them. Search engines and slow phones suffer too. Fixing this by hand means wiring up server rendering, data fetching, caching, error handling and forms yourself.

Remix gives these a fixed home inside the route. A route is a file that exports:

  • a loader that runs on the server and returns the data for the page (GET),
  • an action that handles form submissions and changes data (POST, PUT, DELETE),
  • a component that renders the page,
  • an ErrorBoundary for failures, plus optional meta and links exports.

The router knows which routes match a URL, runs all their loaders in parallel, and renders the nested components with the data. That one idea replaces a lot of useEffect code.

Three modes of React Router

Mode What you get Typical use
Declarative <Routes> and <Route> in a client-only app small SPAs
Data adds loaders, actions, <Form> with createBrowserRouter SPAs that want data APIs
Framework adds a Vite plugin, file-based or config routes, server rendering, type generation, code splitting full-stack apps (the Remix successor)

The router tutorial covers declarative and data mode in detail: see Choosing a Router Mode and the framework mode overview. This track goes deep on framework mode.

What a route module gives you

loader Server data for GET
action Handles form posts
Component Renders the page
ErrorBoundary Catches failures

One file, one URL, everything the page needs.

1 / 2

A route module, for real

This is a complete page in React Router v7 framework mode. It is read-only; the next sections explain every part.

TSX
// app/routes/products.tsx  (real React Router v7, read-only)
import { Form, useLoaderData } from "react-router";
import type { Route } from "./+types/products";
import { listProducts, addProduct } from "~/db.server";

export async function loader({ request }: Route.LoaderArgs) {
  const q = new URL(request.url).searchParams.get("q") ?? "";
  return { products: await listProducts(q) };
}

export async function action({ request }: Route.ActionArgs) {
  const form = await request.formData();
  await addProduct(String(form.get("name")));
  return { ok: true };
}

export default function Products({ loaderData }: Route.ComponentProps) {
  return (
    <main>
      <h1>Products</h1>
      <ul>
        {loaderData.products.map((p) => (
          <li key={p.id}>{p.name}</li>
        ))}
      </ul>
      <Form method="post">
        <input name="name" />
        <button>Add</button>
      </Form>
    </main>
  );
}

There is no useEffect, no loading flag and no API route. The loader supplies data, the <Form> posts to the action, and after the action finishes the router reloads the loader so the list updates by itself.

Stand-in: a route table that answers requests

The first stand-in is a miniature of the server half. It keeps a table of routes, matches a URL, runs the loader and builds an HTML string, returning a real web Response. The real framework does the same job with React and your route files. This stand-in uses plain functions.

JS Stand-in: a tiny server that renders routes

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Each URL goes in as a Request and comes out as a Response with a status code and an HTML body. That function shape, Request in, Response out, is the heart of Remix. Real deployments adapt it to Node, Cloudflare Workers, Deno or any other runtime. Look at the output: the missing page got a 404 status, not just a message.

Why hydration matters

After the server sends HTML, the browser also downloads JavaScript for the same route. React attaches event handlers to the existing markup, which is called hydration. From then on, link clicks do not reload the page: the router fetches only the new loader data and swaps the changed parts of the page. The first visit is server rendered; later navigation is client-side.

Remix also works with JavaScript off. A <Form> is a real HTML form, so the browser can post it, the action runs, and the server answers with a redirect or a new page. JavaScript only makes it smoother (no full reload, pending states). This idea is called progressive enhancement.

Stand-in: hydration versus full page loads

This second stand-in counts what a navigation costs. A full page load fetches the document and every asset again. A client-side navigation fetches only the data for the routes that changed.

JS Stand-in: what a navigation costs

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The layout (nav) is shared by both pages, so a client navigation reloads only the page data. In real Remix, the layout route's loader is skipped entirely unless something told the router it is out of date. You will see how in the loaders chapter.

Strengths and trade-offs

  • Good fit: content sites, shops, dashboards, forms, anything where SEO, fast first paint and reliable forms matter.
  • Less ideal: a purely static brochure site with no data needs a lighter tool, and a fully offline-first app needs more client-side logic than loaders provide.
  • Learning curve: you need to think about what runs on the server and what runs in the browser. The React tutorial covers the component side.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which statement about Remix and React Router v7 is correct?

    The Remix features (loaders, actions, SSR, file routes) were merged into React Router v7 and are used in framework mode, which uses Vite as its build tool.
  2. 2. What does a loader do?

    Loaders provide data to the page. Form submissions (non-GET) go to the action.
  3. 3. What is hydration?

    The server sends finished HTML for fast display. Hydration makes it interactive without drawing it again.
  4. 4. Why does Remix work when JavaScript is disabled?

    This is progressive enhancement: the basics are real HTML forms and links, and JavaScript improves them.

Summary

  • Remix is a full-stack React framework; its features now live in React Router v7 framework mode.
  • A route module bundles a loader, an action, a component, an error boundary and optional metadata.
  • Servers turn a Request into a Response; the browser hydrates the HTML and then navigates client-side.
  • Forms are real HTML forms, so apps degrade gracefully without JavaScript.
  • The stand-ins here mimic ideas in plain JavaScript; real apps use the react-router package.

Next: Project Setup and Folder Structure