React rendering has two distinct phases: the render phase (pure, interruptible, builds a work-in-progress tree) and the commit phase (synchronous, applies DOM mutations and runs effects).
When state changes, React does not immediately update the DOM. Instead, it goes through a two-phase process. The render phase calls your component functions to produce a new virtual tree, and the commit phase applies the resulting changes to the real DOM.
The render phase is pure: React may call your component multiple times, pause, or restart the work. No side effects should happen here. The commit phase is synchronous and cannot be interrupted, ensuring the DOM stays consistent.
After DOM mutations, React runs useLayoutEffect callbacks synchronously (before the browser paints), then yields to the browser for painting, and finally runs useEffect callbacks asynchronously. This ordering gives you fine-grained control over when side effects execute.
Interview framing: define Render Cycle in one sentence, then explain one concrete runtime behavior and one common pitfall with a short code example.