Skip to main content

Complete Built-in Hooks Reference

React Hooks let function components use state, context, refs, effects, scheduling, actions, accessibility IDs, external stores, and developer tooling.

This page is the coverage map for the handbook. It follows the React 19.2 reference and also includes useOptimistic and the web-only useFormStatus Hook.

The complete map​

Hook directory​

HookPrimary purposeUse it when
useStateLocal component stateA component needs to remember a value
useReducerState with explicit transition logicUpdates are related, complex, or event-shaped
useContextRead and subscribe to contextDistant descendants need shared data
useRefHold mutable, non-rendering data or a DOM nodeA value must survive renders without causing one
useImperativeHandleCustomize a component's exposed ref handleA parent needs a small imperative API
useEffectSynchronize with an external systemConnecting to browser, network, timers, or third-party code
useLayoutEffectMeasure or adjust layout before paintA visible layout correction must happen synchronously
useInsertionEffectInsert styles before layout effectsBuilding a CSS-in-JS library
useEffectEventRead latest values from non-reactive Effect logicEffect-connected events should not resubscribe
useMemoCache a calculated valueA measured expensive calculation or stable derived value benefits
useCallbackCache a function identityFunction identity matters to a memoized child or Hook dependency
useTransitionMark updates as non-blockingExpensive UI updates should not block urgent interaction
useDeferredValueDefer a non-critical valueA slow subtree can lag behind an urgent input
useDebugValueLabel custom Hooks in React DevToolsPublishing or debugging reusable custom Hooks
useIdCreate hydration-safe accessibility IDsConnecting labels, descriptions, and controls
useSyncExternalStoreSubscribe safely to external storesReading state owned outside React
useActionStateManage an Action result and pending stateForms or mutations return state
useOptimisticShow temporary optimistic stateThe UI should respond before an Action finishes
useFormStatusRead a parent form's submission statusA child button or status view reacts to form submission

Hooks versus the use API​

use(resource) is a React API, but React's official built-in Hooks list does not classify it as a normal Hook. Unlike Hooks, use may be called inside loops and conditions, although it still must run while React is rendering a component or custom Hook.

Selection flow​

Rules shared by Hooks​

  1. Call Hooks at the top level of a component or custom Hook.
  2. Do not call ordinary Hooks inside loops, conditions, nested functions, or event handlers.
  3. Keep components and Hook callbacks pure during rendering.
  4. Treat dependency arrays as a description of values used, not as a manual scheduling tool.
  5. Prefer deriving values during render before adding Effects or duplicated state.

Production checklist​

  • Enable eslint-plugin-react-hooks and fix warnings instead of suppressing them.
  • Measure before adding useMemo or useCallback.
  • Prefer useEffect over useLayoutEffect unless a pre-paint measurement is required.
  • Reserve useInsertionEffect for styling-library infrastructure.
  • Use stable data IDs for records; useId is not a list-key generator.
  • Keep optimistic UI recoverable when an Action fails.
  • Test external stores under concurrent rendering and server rendering.

Official references​