Bug: eslint-plugin-react-hooks false positive conditional call after foreach #24791
Labels
Component: ESLint Rules
Status: Unconfirmed
A potential issue that we haven't yet confirmed as a bug
Type: Bug
React version:
Steps To Reproduce
npx eslint src
Link to code example: https://stackblitz.com/edit/vitejs-vite-tpaumc?file=src%2FApp.tsx&terminal=dev
The current behavior
Given the following pattern:
I get the following error:
error React Hook "React.useState" is called in function "MyComponent.Ready" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use" react-hooks/rules-of-hooks
The expected behavior
Since MyComponent.Ready is an actual component, I shouldn't get this error.
The text was updated successfully, but these errors were encountered: