Zero to Production React

React from first principles. You build a tiny React first, so the real one stops feeling like magic. Then hooks, concurrency, the Compiler, state management, Server Components, Next.js and what it takes to ship. Every chapter has code you can run and change right on the page.

62 chapters·React 19.3.1·Next.js 16.4.6·Facts checked November 24, 2026
  • Each chapter starts with a problem, builds a solution from scratch, then shows the real API and how it maps back.
  • Code blocks with a Run button are live. Edit them. Your changes and progress stay in this browser.
  • Every chapter ends with interview questions and model answers. Rehearse collects all of them.
  • Want a project on your machine? Starting a React app shows how to create and configure one.

Short on time? Chapters marked ★ are the interview-critical track; the toggle below shows only those.

0 of 62 doneStart: 1. The DOM and the sync problem

Before React

The problem React exists to solve.
  1. 01
    The DOM and the sync problem

    Why hand-written UI updates drift out of sync with your data.

  2. 02
    UI as a function of state

    Describe the screen for any state, then redraw. Simple, and broken.

Build a tiny React

Elements, diffing, keys, Fiber and hooks, from scratch.
  1. 03
    Elements and JSX

    JSX is a function call. Elements are plain objects.

  2. 04
    Rendering elements

    Turn element objects into DOM, with components and props.

  3. 05
    The virtual DOM and diffinginterview-critical

    Compare two trees and touch only what changed.

  4. 06
    Keysinterview-critical

    How React knows which list item is which.

  5. 07
    Fiberinterview-critical

    Rendering you can pause: the work loop and the two phases.

  6. 08
    Hooks from scratchinterview-critical

    useState is an array slot on a fiber. That's why the rules exist.

  7. 09
    Effects from scratch

    Run code after commit, clean it up, and map the toy to real React.

React fundamentals

The real APIs, mapped back to what you built.
  1. 10
    Components and props

    Composition, children, lists and why render must be pure.

  2. 11
    Events

    Synthetic events, delegation at the root, passing handlers down.

  3. 12
    Stateinterview-critical

    Snapshots, batching, immutability and where state should live.

  4. 13
    useReducer

    Move update logic out of event handlers into one pure function.

  5. 14
    Refs

    Values that persist without re-rendering, and handles to the DOM.

  6. 15
    Effectsinterview-critical

    Synchronizing with the outside world, and when not to.

  7. 16
    Contextinterview-critical

    Passing data deep without props, and what it costs.

  8. 17
    Custom hooks

    Reusing stateful logic, plus useId and useSyncExternalStore.

  9. 18
    Component patterns

    Compound components, render props, HOCs and headless UI.

  10. 19
    Forms

    Controlled and uncontrolled inputs, and validation basics.

  11. 20
    Class components

    Lifecycles, mapped to hooks. Still asked, still needed.

  12. 21
    Errors

    Error boundaries, root error handlers and Owner Stacks.

  13. 22
    Portals and Profiler

    Render outside the parent's DOM, and measure renders.

Concurrency and async UI

Scheduling, transitions, Actions and Suspense.
  1. 23
    Rendering and schedulinginterview-critical

    What triggers a render, and how React decides what to do first.

  2. 24
    Transitionsinterview-critical

    Mark updates as non-urgent so the UI stays responsive.

  3. 25
    Actionsinterview-critical

    Async transitions for forms: pending, optimistic, settled.

  4. 26
    Suspense and useinterview-critical

    Waiting declaratively, and the fetching patterns behind it.

  5. 27
    Activity and View Transitions

    Hide UI without losing state, and animate between states.

Performance and the Compiler

Measure, memoize, then let the Compiler do it.
  1. 28
    Measure first

    Profiler, Performance tracks and Core Web Vitals.

  2. 29
    Memoizationinterview-critical

    memo, useMemo and useCallback, and the fixes that beat them.

  3. 30
    The React Compilerinterview-critical

    Automatic memoization: how it works and whether to ship it.

  4. 31
    Big UI

    Virtualization, code splitting and keeping the main thread free.

State management

Every kind of state and the tools for each.
  1. 32
    Kinds of stateinterview-critical

    Local, shared, server, URL, form, persisted and derived.

  2. 33
    Build a storeinterview-critical

    useSyncExternalStore, selectors and tearing, from scratch.

  3. 34
    Redux Toolkit

    Flux, one store, slices, middleware and time travel.

  4. 35
    Zustand

    A store as a hook, with selectors and middleware.

  5. 36
    Atomic state

    Jotai atoms, derived and async atoms.

  6. 37
    Reactive state and signals

    MobX, Valtio, signals, and why React chose differently.

  7. 38
    State machines

    Statecharts, XState, and impossible states made impossible.

  8. 39
    Server stateinterview-critical

    TanStack Query, SWR and RTK Query: caching data you don't own.

  9. 40
    URL and form state

    Search params as state, React Hook Form and Zod.

  10. 41
    Choosing state toolsinterview-critical

    A decision framework and the trade-offs interviewers ask about.

Server rendering and Server Components

Moving work off the client.
  1. 42
    Rendering strategiesinterview-critical

    CSR, SSR, SSG, ISR, streaming, PPR and Server Components compared.

  2. 43
    SSR and hydrationinterview-critical

    Render to HTML, stream it, and bring it to life.

  3. 44
    Server Componentsinterview-critical

    Components that never ship to the browser, and the boundary.

  4. 45
    Server Functionsinterview-critical

    Calling the server from a form, and securing the endpoint.

Next.js

The framework that packages all of it, and its caches.
  1. 46
    The Next.js App Routerinterview-critical

    Files become routes, layouts nest, and loading states stream.

  2. 47
    Data and mutations in Next.js

    Fetching on the server, Server Actions, auth and proxy.ts.

  3. 48
    Caching in Next.jsinterview-critical

    Cache Components, use cache, tags, and the older model.

  4. 49
    Rendering and deploying Next.js

    Static shells, dynamic holes, runtimes and where it runs.

  5. 50
    Next.js versions and the Pages Router

    What changed from 14 to 16, and the router you'll still meet.

  6. 51
    Caching across the stackinterview-critical

    Every cache from component to CDN, and how to invalidate each.

Ecosystem and tooling

Starting, routing, typing, styling and testing.
  1. 52
    Starting a React appinterview-critical

    Frameworks, Vite, bundlers, and how to choose.

  2. 53
    Routing

    React Router and TanStack Router outside Next.js.

  3. 54
    TypeScript with React

    Typing props, events, refs, generics and state.

  4. 55
    Styling

    CSS Modules, Tailwind, CSS-in-JS and component libraries.

  5. 56
    Testing

    Testing Library, Vitest, MSW and Playwright.

  6. 57
    Accessibility

    Semantic HTML, ARIA, focus and checking it.

  7. 58
    Tooling and DX

    ESLint, formatters, Storybook and DevTools.

Production

Shipping and running React for real.
  1. 59
    The production checklistinterview-critical

    Security, monitoring, performance budgets, SEO and CI.

  2. 60
    Architecture at scale

    Boundaries, design systems, monorepos and micro-frontends.

Versions and rehearsal

How React got here, and how to talk about it.
  1. 61
    React versionsinterview-critical

    From hooks in 16.8 to React 19.3, and how to upgrade.

  2. 62
    Interview rehearsalinterview-critical

    How to structure answers, system design prompts and traps.