QuizNot attempted
useMemo with a stable dependency
1–4 to choose, Enter to submit
Show answer & explanation
Correct answer:
- 1
useMemorecomputes only when a dependency changes byObject.isitemskeeps the same reference, so clicks re-render without recomputing: one log.- Not 3 or 4: re-renders alone don't invalidate a memo.
- Not 0: it must compute once on mount.