React · Junior · Question 30 of 75
When does a child component re-render by default?
- 1Only when its props change (by reference)
- ✓Correct answer: When the parent re-renders, even if the props are the same
- 3Only when its own state or context changes
Explanation
A parent render re-renders the whole subtree by default. Other causes: a change in its own state and a change in a context it reads. React.memo (or the React Compiler automatically) lets you skip rendering when props are equal. A re-render isn't a DOM change: the DOM changes only if there's a difference.