QuizNot attempted
React.memo without useCallback
1–4 to choose, Enter to submit
Show answer & explanation
Correct answer:
- 4
React.memoshallow-compares props, buthandleClickis a new function on everyParentrender, soonClickalways differs andMemoChildre-renders each time: 1 + 3 = 4.- Not 1: that needs a stable
onClick(useCallback). - Not 3: the mount render also logs.
- Not 0: memo never skips the first render.