React Render and Commit Phases Explained

Every React screen update moves through render and commit. Learn what each phase does, why rendering must be pure, and when the DOM changes.

5 min read

React render and commit are the two phases behind every update in a React app. Rendering calls your components to work out what the screen should show, and committing applies that result to the DOM.

A state change, a new prop, or the first load all follow the same path. Understanding the split explains why a slow component slows rendering, not the browser paint.

The diagram shows the order from trigger to paint:

How a state update reaches the screen

Each box is one phase with one job. The trigger starts the work, rendering computes the new description, committing updates the page, and the browser paints the pixels.

Trigger: what starts a render

A render starts in one of two ways. The first load calls the root component once, which is the initial render. After that, every state update queues another render.

Frameworks such as Next.js hide the createRoot call that starts the first render, but the initial render still happens once on mount. Calling a set function twice often still results in one visible update, because React batches the work.

You do not call a component to re-render it. Calling the set function from a state hook is the trigger, and React decides when the work happens.

Render: React calls your components

Rendering means React calls your component functions and asks for the JSX they return. It walks the whole tree below the updated component until there is nothing left to call. React keeps rendering until every nested component has returned its JSX.

Rendering must be pure. The same props and state should produce the same JSX, and the function should not change anything outside itself. In development, Strict Mode calls components twice to surface impure functions, which the guide on React StrictMode explains.

Commit: React updates the DOM

After rendering, React compares the new description with the previous one and changes only the DOM nodes that differ. Initial renders create all the nodes at once, while re-renders apply the smallest set of edits.

App.jsxApp.jsx
function Clock({ time }) {
  return (
    <>
      <h1>{time}</h1>
      <input placeholder="Type here" />
    </>
  );
}

When time changes every second, React updates only the text inside the heading. The input keeps whatever you typed, because React sees it in the same place and leaves that node alone.

The comparing step inside commit is called reconciliation. The guide on the React Virtual DOM and reconciliation covers the diffing in detail.

Rune AI

Rune AI

Key Insights

  • A trigger starts each update: initial mount or a state change.
  • Rendering means React calls your component functions.
  • Rendering must stay pure and not change anything outside itself.
  • Commit updates only the DOM nodes that changed.
  • Strict Mode double-calls components in development.
RunePowered by Rune AI

Frequently Asked Questions

What is the difference between render and commit?

Rendering calls your component functions to produce a description of the UI. Committing compares that description with the previous one and updates only the DOM nodes that changed.

What triggers a render?

The initial mount triggers the first render. After that, a state update through its set function queues the next render.

Does rendering always change the DOM?

No. If the render output is the same as before, React commits nothing. React only touches the DOM nodes that actually differ.

Conclusion

Render and commit are the two phases behind every React update. A trigger starts a render, React calls your components to produce a new description, and the commit applies only the changes that matter to the DOM. Keeping render pure is what makes that process predictable.