Pages

Topics

Tools

↑↓navigate↵openescclose

React guides

Every published React guide, newest first, with practical examples you can copy into your own project.

3,815 guides across 14 topics

Topics

Latest React guides

3D illustration of Fiber virtual DOM nodes matched by stable keys while a list is reordered
React

React Keys and Reconciliation: How List Diffing Works and Index Key Bugs

React matches children by key, not by content. Why index keys shift state on insert, and how a key doubles as an intentional reset.

ReactRenderingPerformance
3D illustration of controlled state-driven inputs contrasted with FormData streams feeding form actions
React

React Forms: Controlled vs Uncontrolled Inputs, useActionState, and Validation

State-driven inputs versus FormData, and the React 19 action APIs that make server validation round-trip without losing the user's input.

ReactFormsReact 19
3D illustration of server-rendered RSC payloads streaming across a use client hydration boundary
React

React Server Components vs Client Components: Serialization and Boundaries

use client marks a module graph, not a component. What runs where, what can cross the boundary, and how to keep interactive islands small.

ReactServer ComponentsArchitecture
3D illustration of Suspense loading shields and ErrorBoundary isolation cages around subtrees
React

React Error Boundaries and Suspense: Fallback UI and Async Recovery

Boundaries catch render errors, Suspense shows pending UI, and neither catches the other's case. How to compose them so a failed widget does not blank the page.

ReactError HandlingSuspense
3D illustration of reusable custom hook capsules plugging stateful logic into several UI components
React

React Custom Hooks: Design Patterns, Rules of Hooks, and TypeScript Types

A custom hook shares logic, never state. The rules that keep hook order stable, plus debounce, localStorage and fetch hooks written correctly.

ReactHooksTypeScript
3D illustration of split state and dispatch context providers broadcasting reducer actions down a tree
React

React useContext and useReducer: Scalable State Sharing Without Redux

Context transports state and useReducer names the transitions. Splitting the two contexts is what keeps dispatch-only components from re-rendering.

ReactState ManagementHooks
3D illustration of memoized dependency cache gates preserving referential equality down a component tree
React

React useMemo vs useCallback: Memoization, React.memo, and When to Skip

Three tools for three different problems: a cached value, a stable function identity, a skipped subtree. How to tell which one the render cost needs.

ReactPerformanceHooks
3D illustration of persistent mutable current-reference boxes connecting directly to DOM nodes
React

React useRef: DOM Access, Mutable Values, and Ref Forwarding

A ref holds a value for the lifetime of the component without re-rendering. When to reach for the DOM, and how refs behave in React 19.

ReactHooksDOM
3D illustration of a component lifecycle synchronised with AbortController fetch cancellation
React

React useEffect: Dependency Arrays, Cleanup Functions, and Race Conditions

Effects synchronise with the outside world, and cleanup is what makes that safe. Dependency rules, abort controllers and the loops that follow from unstable deps.

ReactHooksEffects
3D illustration of a React state update queue batching functional updater callbacks into one render
React

React useState: Functional Updates, Automatic Batching, and Stale State

State is a snapshot, not a variable. Why three setCount calls add one, how React 18 batches after await, and how to update arrays and objects safely.

ReactHooksState Management