React · Middle · Question 16 of 75

What changed about passing ref to function components in React 19?

Explanation

In React 19, function Input({ ref, ...props }) receives ref directly. forwardRef still works but will be deprecated. Also, a callback ref can now return a cleanup function.

Further reading

Problem with a question

React · Middle · question 16

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