React · Middle · Question 16 of 75
What changed about passing ref to function components in React 19?
- ✓Correct answer:
refcan be received as a regular prop;forwardRefis no longer needed - 2Passing
refto function components is now forbidden - 3
refnow works only with class components
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.