In React, a state update schedules rendering. The render phase calculates the next UI; the commit phase applies the needed DOM changes.
The demo separates counter state, calculated result, and visible value. They briefly differ between stages, then agree after commit. Avoid changing managed DOM directly so it diverges from state.
When to use
Use this model to understand when updates appear and to separate rendering from effects.