forwardRef
The older React API needed to let a function component receive a ref from its parent.
In more detail
Since React 19, function components receive ref as a normal prop, so forwardRef is no longer needed in new code and will be deprecated. You will still see it in older code and libraries.
Related terms
- ref — A React handle that points at a real DOM element, so code can focus it, measure it or attach listeners.
- useImperativeHandle — The React hook that lets a component choose exactly which methods its parent gets through a ref, instead of the raw DOM node.
Taught in
- useRef Mechanics: DOM References And Mutable Persistent State — React 19 & Modern Component Architecture
- useImperativeHandle: Controlled Ref Forwarding Boundaries — React 19 & Modern Component Architecture