React · Middle · Question 57 of 75
How does forwardRef relate to React 19?
- ✓Correct answer: In React 19 function components accept
refas a regular prop, soforwardRefis no longer needed for new code - 2
forwardRefis required for every component in React 19 - 3Refs can't be passed to components at all
Explanation
Declare function Input({ ref, ...props }) and pass it to the DOM element. forwardRef still works and will be deprecated over time.