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 type-safe generic React component blocks snapping tightly together with typed DOM event handlers
React

React with TypeScript: Generic Components, PropsWithChildren, and Event Types

Generic props that infer from data, PropsWithChildren instead of React.FC, and element-scoped event types that keep currentTarget typed.

ReactTypeScriptComponents
3D illustration of component flamegraph duration bars highlighting actualDuration versus baseDuration bottlenecks
React

React Profiler API: Measuring Render Timings and Identifying Wasted Re-Renders

actualDuration versus baseDuration, phase names that tell you who triggered a commit, and how to ship the numbers without flooding a backend.

ReactPerformanceDebugging
3D illustration of an encapsulated child component exposing only safe focus and scroll methods through a controlled ref gate
React

React useImperativeHandle: Exposing Custom Ref APIs Without Breaking Encapsulation

A ref gate that exposes three methods instead of the whole DOM node, with the React 19 ref-prop form and the dependency rules that keep it fresh.

ReactHooksTypeScript
3D illustration of a monolithic JavaScript bundle splitting into on-demand lazy route chunks loaded inside Suspense boundaries
React

React.lazy and Code Splitting: Route Chunks, Preloading, and Suspense

Where the split points belong, how to preload on intent, and how to recover when a stale chunk 404s after a deployment.

ReactPerformanceBundling
3D illustration of development-mode double render and mount-remount diagnostic probes detecting missing effect cleanups
React

React StrictMode: Why Components Render Twice and Impure Side-Effect Detection

Double render, double Effect setup and double reducer calls are diagnostics, not bugs. What each one detects and how to fix the code it catches.

ReactDebuggingBest Practices
3D illustration of deterministic SSR hydration id trees synced with tear-free external store snapshots
React

React useId and useSyncExternalStore: SSR-Safe Hydration and External Stores

Generated ids that match on both sides of hydration, and external store reads that never tear and never loop.

ReactSSRHooks
3D illustration of optimistic UI state cards with pending form indicators reconciling against async server responses
React

React useOptimistic and useFormStatus: Instant UI Feedback in React 19

Optimistic state that reverts by itself when the Action fails, plus form pending status read from inside the form instead of lifted state.

ReactReact 19Hooks
3D illustration of urgent typing input lanes prioritized ahead of interruptible background transition renders
React

React useTransition and useDeferredValue: Non-Blocking Concurrent UI Updates

Transitions let React throw away background work when typing arrives. Which hook defers what, and why a controlled input must never be transitioned.

ReactConcurrencyPerformance
3D illustration of a browser paint timeline with a synchronous layout measurement step running before the frame is presented
React

React useLayoutEffect vs useEffect: Synchronous DOM Measurements and Flicker Fixes

One hook runs before the browser paints and one after. Measuring layout in the wrong one costs a visible frame of flicker on every mount.

ReactHooksRendering
3D illustration of a modal DOM node portalled outside its parent container while React events still bubble through the component tree
React

React Portals: createPortal for Modals, Tooltips, and Event Bubbling

Why portal content still bubbles events through the React tree, and how to move a modal out of a clipping container without losing context or focus.

ReactDOMPortals