QuizNot attempted
What makes a component re-render?
1–4 to choose, Enter to submit
Show answer & explanation
Correct answers:
- Its state changes
- Its parent re-renders (and it is not memoized)
- A context it consumes changes
- A component re-renders when its own state changes, when its parent re-renders (unless memoized and props are equal), or when a context it consumes changes.
- Not mutating a ref: refs are deliberately outside React's update system, which is why they hold timers, previous values and DOM nodes.