Open
Description
Is there an existing issue for this?
- I have searched the existing issues and my issue is unique
- My issue appears in the command-line and not only in the text editor
Description Overview
The rule react/destructuring-assignment won't apply on component passed in forwardRef.
Expected Behavior
import { forwardRef } from "react";
interface Props {
day: string;
}
// Code to expect error but works just fine
export const MyComponent = forwardRef<HTMLDivElement, Props>(
function MyComponent(props, ref) {
return <div ref={ref}>{props.day}</div>;
}
);
// Correct code
export const MyComponent = forwardRef<HTMLDivElement, Props>(
function MyComponent({ day }, ref) {
return <div ref={ref}>{day}</div>;
}
);
eslint-plugin-react version
v7.33.2
eslint version
v8.48.0
node version
v18.15.0