QuizNot attempted
Inline callback as an effect dependency
1–4 to choose, Enter to submit
Show answer & explanation
Correct answer:
- 4
handleUpdateis a new function on everyParentrender, soonUpdatefails theObject.iscomparison each time and the child's effect re-runs: mount + 3 clicks = 4.- Not 1: that needs a stable reference (
useCallback). - Not 3: the mount run also logs.
- Not 0: effects always run after mount.