Symptom
Despite wrapping ExerciseItem with React.memo, it re-renders on every parent render. The render counter increases even when the item's data hasn't changed. Simply selecting a different item causes all items to re-render.
Expected
A memoized component should skip re-renders when its props haven't changed. Only the item whose selection state changes should re-render.
What you know
The parent component creates a handleSelect function inline (without useCallback). This function is passed as the onSelect prop to memoized children. The parent re-renders when selection state changes.
Hints
TypeScript
TypeScript ready
Test Output
▶
Click "Run Tests" to execute your code