react
deprecation_warning
ai_generated
true
Warning: forwardRef render functions accept exactly two parameters: props and ref
ID: react/forward-ref-deprecation
90%Fix Rate
92%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 18 | active | — | — | — |
Root Cause
forwardRef component has wrong signature or is being deprecated (React 19+ removes it).
genericWorkarounds
-
92% success Ensure function takes exactly (props, ref) parameters
const Input = forwardRef((props, ref) => <input ref={ref} {...props} />); -
85% success In React 19+, ref is a regular prop — no need for forwardRef
function Input({ ref, ...props }) { return <input ref={ref} {...props} />; }
Dead Ends
Common approaches that don't work:
-
Remove forwardRef and pass ref as a regular prop
60% fail
In React <19, ref is special and won't be forwarded as a prop
Error Chain
Frequently confused with: