Conceptual
Login

Render Phase vs Commit Phase

React first calls components to compute the next tree (render phase — pure, interruptible, may run more than once or be discarded), then applies the resulting mutations to the DOM and runs effects (commit phase — synchronous, exactly once). Anything with observable side effects belongs after commit, never during render.

This Concept is waiting for its first lesson!

React first calls components to compute the next tree (render phase — pure, interruptible, may run more than once or be discarded), then applies the resulting mutations to the DOM and runs effects (commit phase — synchronous, exactly once). Anything with observable side effects belongs after commit, never during render.

Are you a teacher? Sign in to start contributing.

Sign In