React · Middle · Question 71 of 75

What happens if a parent passes onChange={() => {}} inline to a memoized child?

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.

Further reading

Problem with a question

React · Middle · question 71

Test yourself

Take the React · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz