React · Middle · Question 71 of 75
What happens if a parent passes onChange={() => {}} inline to a memoized child?
- ✓Correct answer: A new function is created on each render, so
memosees changed props and re-renders the child - 2React reuses the function automatically
- 3The child never re-renders
Explanation
Wrap it in useCallback with correct dependencies, or let the React Compiler memoize it. Without memo on the child, stable callbacks don't matter.