commit phase
The part of an update where React applies the calculated changes to the real DOM, all at once and without interruption.
In more detail
After the commit React updates refs, runs layout effects before the browser paints, and runs ordinary effects afterwards. The commit runs synchronously so users never see a half-applied update.
Related terms
- render phase — The part of an update where React calls your components and compares the results with the previous tree, without touching the page.
- useLayoutEffect — A version of useEffect that runs synchronously after React changes the DOM but before the browser paints the screen.
- useEffect — The React hook for running side work, such as adding listeners or changing document.body, after a component renders.
- DOM — The tree of objects a browser builds from a web page, which scripts read and change to update what is on screen.
Taught in
- Component Purity: Pure Functions, Idempotence And Side Effects — React 19 & Modern Component Architecture
- Virtual DOM vs Real DOM: The Reconciliation Cost Model — React 19 & Modern Component Architecture
- useLayoutEffect vs useEffect: Painting And Synchronous Reads — React 19 & Modern Component Architecture
- Render Diagnostics: Profiling Re-Renders with React DevTools — React 19 & Modern Component Architecture