React Rendering Lifecycle
React's rendering lifecycle is the sequence of phases React runs whenever a component's state or props change — from scheduling the update through reconciliation to committing the result to the DOM and running side effects.
React's rendering lifecycle is the sequence of phases React runs whenever a component's state or props change — from scheduling the update through reconciliation to committing the result to the DOM and running side effects.
React's architecture since version 16 is built around the Fiber reconciler, which splits rendering into two main phases: the render phase (also called the reconciliation phase) and the commit phase. This split is fundamental to React's ability to interrupt, pause, and resume work — the mechanism behind Concurrent Mode features like useTransition and Suspense.
The lifecycle begins when a state update is triggered — via useState setter, useReducer dispatch, or a context value change. React schedules the update at a priority level (urgent updates like typing happen synchronously; deferred updates like data loading can be interrupted). During the render phase, React calls the component function again, gets the new JSX, and runs the reconciliation algorithm against the previous fiber tree (see Virtual DOM Diffing). This phase is pure and side-effect-free — React may call the render function multiple times in Strict Mode to surface impurity bugs. Because it produces no side effects, it can be safely interrupted.
The commit phase cannot be interrupted. React walks the effect list built during reconciliation and applies DOM mutations: insertions, updates, and deletions. This phase has three sub-phases: before mutation (reads the DOM for snapshot values), mutation (applies DOM changes), and layout (fires useLayoutEffect synchronously). After paint, React fires useEffect callbacks asynchronously on the microtask queue — this is where data fetches, subscriptions, and analytics calls belong. useLayoutEffect fires synchronously after DOM mutation but before paint, making it the correct place for DOM measurements that would flash visually if deferred.
React.memo, useMemo, and useCallback are bailout mechanisms that short-circuit the render phase for components and values that haven't changed, reducing work for the reconciler. Understanding where each hook fires relative to these phases is the key to avoiding stale closure bugs and unnecessary renders.