React · Middle · Question 62 of 75
What happens when a component's state changes but the output JSX is identical?
- ✓Correct answer: React re-renders the component but commits no DOM changes, because the diff finds nothing to update
- 2React reloads the page
- 3React skips calling the component function
Explanation
Rendering (calling components) and committing (changing the DOM) are separate. React only touches DOM nodes whose output differs.