# Warning: forwardRef render functions accept exactly two parameters: props and ref. Did you mean to pass a ref?

- **ID:** `react/forwardref-children-prop-warning`
- **Domain:** react
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

A component wrapped in React.forwardRef is receiving more than two arguments (e.g., props, ref, and an extra third argument like children) in its render function, which violates the forwardRef signature.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| react@18.2.0 | active | — | — |
| react@17.0.2 | active | — | — |

## Workarounds

1. **Change the forwardRef render function to accept exactly two parameters: props and ref. Access children via props.children.** (90% success)
   ```
   Change the forwardRef render function to accept exactly two parameters: props and ref. Access children via props.children.
   ```
2. **If using TypeScript, ensure the forwardRef type signature matches: React.forwardRef<RefType, PropsType>((props, ref) => ...)** (85% success)
   ```
   If using TypeScript, ensure the forwardRef type signature matches: React.forwardRef<RefType, PropsType>((props, ref) => ...)
   ```

## Dead Ends

- **Adding a third parameter to the forwardRef render function to accept children explicitly** — React.forwardRef only provides two arguments; any extra parameter will be undefined and the warning persists. (95% fail)
- **Wrapping the component in another HOC that passes children as a separate prop** — The underlying forwardRef still receives the extra argument; the warning is about the render function signature, not prop structure. (80% fail)
- **Ignoring the warning as it doesn't break the app immediately** — The warning indicates potential ref forwarding issues that can cause bugs with focus management or third-party libraries. (70% fail)
