React · Senior · Question 3 of 75

How does the render phase differ from the commit phase?

Explanation

In the render phase, React calls components and computes the diff - it can be interrupted, discarded and restarted, which is why rendering must be pure. In the commit phase, changes are applied to the DOM all at once without interruption, then layout effects run, and after painting - regular effects.

Further reading

Problem with a question

React · Senior · question 3

Test yourself

Take the React · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz