React 19 Documentation

Knowledge base from the official React 19 documentation (react.dev) — Learn guides, API reference (Hooks/Components/APIs), React DOM, React Compiler, React Server Components directives, and the Rules of React. Use when building or debugging React components, choosing between similar Hooks (useEffect vs useLayoutEffect, useMemo vs useCallback, useTransition vs useDeferredValue), looking up a Hook/API signature, deciding server vs. client component boundaries, or diagnosing a Rules-of-Hooks/purity violation.

116 capítulos

React 19 Documentation

Package: react, react-dom | Chapters: 116 (41 Learn + 4 Compiler + 2 ESLint + 44 API Reference + 1 Compiler Config + 17 React DOM + 4 RSC Directives + 3 Rules of React) | Generated: 2026-08-25

How to Use This Skill

  • Without arguments — load Core Patterns & Conventions below for the concepts that recur across the whole API
  • With a Hook/API/component name — ask about useEffect, createRoot, Suspense-style topics; I find and read the matching chapter
  • With a chapter number — ask for ch053; I load that specific chapter
  • With a "how do I…" question — check patterns.md (techniques) and cheatsheet.md (decision rules) first; they cover the recurring judgment calls
  • Browse — ask "what chapters do you have?" or "what's in the Hooks/React DOM group?" to see the full index

When you ask about a topic not covered in Core Patterns below, I will read the relevant chapter file before answering.


Core Patterns & Conventions

Rendering must be pure (Ch 18, Ch 114). No side effects, no mutation of anything that predates the current render — this single rule underlies Strict Mode's double-invoke behavior, React Compiler's automatic memoization, and why state/props are treated as read-only snapshots (Ch 23).

Never mutate state — always replace it. Objects need a spread-and-override (Ch 25); arrays need map/filter/spread instead of push/splice (Ch 26). This is what lets React detect a change at all.

State is a snapshot fixed within one render (Ch 23). Calling a setter never changes the value during the render/handler that called it — only the next render sees the update. When several updates to the same value must compound in one handler, use the updater-function form (setX(x => x + 1), Ch 24).

Effects synchronize with the outside world; event handlers respond to interactions (Ch 20, Ch 36, Ch 37). Before writing useEffect, check Ch 37 — a large share of "necessary" Effects are actually derived values (compute during render) or interaction logic (belongs in a handler).

Hooks: top-level only, same order every render, only from component/Hook bodies (Ch 115-116). This is mechanical, not stylistic — React tracks Hook state by call position. use (Ch 91) is the sole documented exception.

key controls identity, not just list rendering (Ch 17, Ch 30). Same component type at the same tree position preserves state across renders; changing key forces a full remount — the standard deliberate "reset this component" technique.

Server vs. Client is a directive, not a runtime check. No directive = Server Component by default in an RSC app (Ch 110); 'use client' (Ch 112) opts a subtree into browser execution; 'use server' (Ch 113) marks a function as a client-callable, server-only network boundary. Props/arguments crossing either boundary must be serializable.

Prefer derived values and lifted state over redundant/duplicated state (Ch 28, Ch 3). If a value can be computed from existing props/state at render time, don't also store it — this is the single most common source of state-sync bugs.

React Compiler (Ch 42) automates most manual useMemo/useCallback/memo where it can prove the Rules of React are followed — existing manual memoization stays valid, but a codebase clean under eslint-plugin-react-hooks's full rule set (Ch 46-47) is largely compiler-ready by construction.


Chapter Index

Learn — Getting Started

#TitleKey Concepts
ch001Quick Startcomponents, JSX, useState, lifting state up
ch002Tutorial: Tic-Tac-Toelifting state, immutable history, time travel
ch003Thinking in React5-step process, component hierarchy, state placement
ch004Installationtry React, framework vs. from-scratch vs. existing project
ch005Add React to an Existing Projectpartial mounting, createRoot, incremental adoption
ch006Build a React App from ScratchVite/Parcel/Rsbuild, routing, data fetching, rendering strategy
ch007Creating a React AppNext.js, React Router, Expo, Server Components
ch008Editor SetupESLint, eslint-plugin-react-hooks, Prettier
ch009Using TypeScripttyping props, Hooks, ComponentProps utility type
ch010React Developer ToolsComponents/Profiler panels, standalone devtools

Learn — Describing the UI

#TitleKey Concepts
ch011Your First Componentcapitalized names, never nest definitions
ch012Importing and Exporting Componentsdefault vs. named exports
ch013Writing Markup with JSXsingle root, close tags, camelCase
ch014JavaScript in JSX with Curly Braces{} escape hatch, double-curly style objects
ch015Passing Props to a Componentdestructuring, defaults, spread, children
ch016Conditional Renderingif/ternary/&&, the && number pitfall
ch017Rendering Listsmap/filter, key rules
ch018Keeping Components Purepurity, side effects, Strict Mode
ch019Understanding Your UI as a Treerender tree vs. module dependency tree

Learn — Adding Interactivity

#TitleKey Concepts
ch020Responding to EventsonClick, stopPropagation, preventDefault
ch021State: A Component's MemoryuseState mechanics, per-instance isolation
ch022Render and Committrigger/render/commit, DOM diffing
ch023State as a Snapshotfixed values within a render
ch024Queueing a Series of State Updatesbatching, updater functions
ch025Updating Objects in Statespread, read-only state
ch026Updating Arrays in Statenon-mutating array methods

Learn — Managing State

#TitleKey Concepts
ch027Reacting to Input with Statedeclarative UI, visual states
ch028Choosing the State Structuregrouping, redundancy, duplication, nesting
ch029Sharing State Between Componentslifting state up, single source of truth
ch030Preserving and Resetting Statetree position, key-based reset
ch031Extracting State Logic into a Reduceractions, pure reducers
ch032Passing Data Deeply with ContextcreateContext, useContext, prop drilling
ch033Scaling Up with Reducer and Contextsplit state/dispatch contexts

Learn — Escape Hatches

#TitleKey Concepts
ch034Referencing Values with RefsuseRef, refs vs. state
ch035Manipulating the DOM with Refsfocus, scroll, DOM ref timing
ch036Synchronizing with EffectsuseEffect shape, cleanup, dependencies
ch037You Might Not Need an Effectderived state, event logic, key-based reset
ch038Lifecycle of Reactive Effectsper-render Effect model, reactive values
ch039Separating Events from EffectsuseEffectEvent, non-reactive reads
ch040Removing Effect Dependenciesunstable object/function deps
ch041Reusing Logic with Custom Hookscustom Hook rules, shared logic vs. shared state

React Compiler

#TitleKey Concepts
ch042React Compiler — Introductionautomatic memoization
ch043React Compiler — InstallationBabel plugin, ESLint integration
ch044React Compiler — Incremental Adoptiondirectory rollout, "use memo", gating
ch045React Compiler — Debugging and Troubleshooting"use no memo" isolation workflow

ESLint Plugin React Hooks

#TitleKey Concepts
ch046Setup & Configurationrecommended preset, gating, globals
ch047Rules Referencerules-of-hooks, exhaustive-deps, purity, immutability

API Reference — Hooks

#TitleKey Concepts
ch048useActionStateActions, dispatchAction, isPending
ch049useCallbackstable function identity
ch050useContextnearest-provider resolution
ch051useDebugValuecustom Hook DevTools labels
ch052useDeferredValuelagging value, pairs with memo
ch053useEffectsetup/cleanup, dependency array
ch054useEffectEventnon-reactive Effect logic
ch055useIdSSR-safe accessibility IDs
ch056useImperativeHandlecustom ref handle
ch057useInsertionEffectCSS-in-JS pre-layout injection
ch058useLayoutEffectsynchronous pre-paint measurement
ch059useMemocached calculation
ch060useOptimisticoptimistic UI, Actions
ch061useReducerdispatch, lazy init
ch062useRefmutable box, DOM refs
ch063useStateinitializer function, updater form
ch064useSyncExternalStoreexternal store subscription, tear-safety
ch065useTransitionlow-priority updates, Actions

API Reference — Components

#TitleKey Concepts
ch066Activityhidden-but-mounted subtrees
ch067Fragmentgrouping without a DOM node
ch068Profilerprogrammatic render timing
ch069StrictModedev-only double-invoke checks
ch070Suspensefallback coordination
ch071ViewTransitionnative View Transitions API

API Reference — APIs

#TitleKey Concepts
ch072acttest-only update flushing
ch073addTransitionTypetagging transitions for ViewTransition
ch074cacheper-server-request memoization (RSC)
ch075cacheSignalabort signal for cached work (RSC)
ch076captureOwnerStackdev-only owner stack for tooling
ch077Childrenmap/count/only/toArray over children
ch078cloneElementlegacy element cloning
ch079Component (legacy)class lifecycle, error boundaries
ch080createContextContext object creation
ch081createElementwhat JSX compiles to
ch082createRefclass-component-only ref creation
ch083experimental_taintObjectReferenceRSC object leak protection
ch084experimental_taintUniqueValueRSC secret-value leak protection
ch085forwardReflegacy ref forwarding
ch086isValidElementReact-element type guard
ch087lazycode-splitting, requires Suspense
ch088memoshallow prop comparison, skip re-render
ch089PureComponent (legacy)class-component shallow comparison
ch090startTransitionstandalone transition function
ch091useconditional promise/Context reads

React Compiler — Configuration

#TitleKey Concepts
ch092Configuration & Directives Referencetarget, panicThreshold, "use memo"/"use no memo"

React DOM

#TitleKey Concepts
ch093React DOM — Client OverviewcreateRoot vs. hydrateRoot
ch094createRootclient-only root attachment
ch095hydrateRootSSR hydration, mismatch handling
ch096Common ComponentsclassName, style, dangerouslySetInnerHTML
ch097<form>function action, Server Function integration
ch098<input>controlled vs. uncontrolled
ch099<select>value on the select, not the option
ch100<textarea>value/defaultValue, not children
ch101<option>, <progress>, <title>selection ownership, indeterminate, hoisted title
ch102createPortalDOM escape, React-tree event bubbling
ch103flushSyncforced synchronous commit
ch104useFormStatusnested form pending status
ch105Resource Preloading APIspreconnect, preload, preinit family
ch106renderToPipeableStreamNode streaming SSR
ch107renderToReadableStreamWeb Streams SSR
ch108Server Static & Resume APIsrenderToString, resume
ch109Static Prerender APIsprerender, resumeAndPrerender

Directives — React Server Components

#TitleKey Concepts
ch110Server Componentsserver-only rendering, zero client bundle
ch111Server Functions'use server', callable from client
ch112'use client'client boundary directive
ch113'use server'Server Function directive mechanics

Rules of React

#TitleKey Concepts
ch114Components and Hooks Must Be Pureidempotency, no side effects in render
ch115React Calls Components and Hooksnever call directly, always via JSX
ch116Rules of Hookstop-level only, call-order tracking

Topic Index

  • Actions → ch048, ch060, ch065, ch097
  • Batching / update queueing → ch023, ch024, ch063
  • Compiler (React Compiler) → ch042, ch043, ch044, ch045, ch092
  • Context → ch032, ch033, ch050, ch080
  • Controlled vs. uncontrolled → ch098, ch099, ch100
  • Custom Hooks → ch041, ch051
  • Effects (general) → ch036, ch037, ch038, ch039, ch040, ch053
  • ESLint / linting → ch008, ch046, ch047
  • Error boundaries → ch047, ch079
  • Hooks (list of all) → ch048-ch065
  • Immutability (objects/arrays) → ch025, ch026, ch028
  • Key (identity/reset) → ch017, ch030
  • Lists / rendering arrays → ch017, ch077
  • Memoization → ch042, ch049, ch059, ch088, ch089
  • Portals → ch102
  • Purity → ch018, ch114
  • Refs → ch034, ch035, ch056, ch062, ch078, ch082, ch085
  • Rules of Hooks / Rules of React → ch114, ch115, ch116
  • Server Components / RSC → ch074, ch075, ch083, ch084, ch110, ch111, ch112, ch113
  • SSR / streaming → ch095, ch106, ch107, ch108, ch109
  • State management → ch021, ch027, ch028, ch029, ch031, ch033
  • Suspense → ch070, ch087, ch091, ch106
  • TypeScript → ch009
  • View Transitions / animation → ch071, ch073

Supporting Files

  • glossary.md — key terms with definitions
  • patterns.md — recurring techniques (lifting state, reducer+context, custom Hooks, streaming SSR, RSC boundaries)
  • cheatsheet.md — decision tables (which Hook, controlled vs. uncontrolled, Effect vs. handler, Server vs. Client Component)

Scope & Limits

This skill covers the official React 19 documentation (react.dev) as of the fetch date in the source: the Learn guides, the full API reference (Hooks, Components, APIs, React DOM), React Compiler, the ESLint plugin's rules, React Server Components directives, and the Rules of React.

Related skills in this library: nextjs-docs covers Next.js, the full-stack framework built on React that currently has the most complete React Server Components implementation (Ch 7, Ch 110) — when working in a Next.js App Router codebase, consult nextjs-docs for routing/data-fetching/deployment concerns and react-docs for the underlying component/Hook/rendering-model behavior. react-hook-form-docs covers a form library built on React Hooks — consult it for form-specific state management beyond what <form action>/useActionState/useFormStatus (Ch 97, Ch 48, Ch 104) cover natively.

The source aggregates 174 individual react.dev pages; a small number of purely navigational "section overview" stub pages (e.g. "Built-in React Hooks", "React DOM APIs") were folded into their group's chapter intros here rather than kept as standalone chapters, and a handful of very short, closely related reference pages (ESLint rules, React Compiler config options, resource-preloading functions, small React DOM elements, server static/prerender API variants) were consolidated into single denser chapters rather than one chapter per page — each consolidation is noted in that chapter's own scope.