Skip to content

Allow hooks in static member components#36413

Open
raashish1601 wants to merge 1 commit intofacebook:mainfrom
raashish1601:codex/rules-of-hooks-member-components
Open

Allow hooks in static member components#36413
raashish1601 wants to merge 1 commit intofacebook:mainfrom
raashish1601:codex/rules-of-hooks-member-components

Conversation

@raashish1601
Copy link
Copy Markdown

Summary

Fixes #24791.

rules-of-hooks already recognizes PascalCase identifiers as components. This extends that component-name check to PascalCase member expressions, so static member components like MyComponent.Ready = () => { useHook(); } are handled the same way when they are used as <MyComponent.Ready />.

Tests

  • corepack yarn --cwd packages/eslint-plugin-react-hooks jest ESLintRulesOfHooks-test --runInBand
  • corepack yarn --cwd packages/eslint-plugin-react-hooks typecheck
  • git diff --check

@meta-cla meta-cla Bot added the CLA Signed label May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: eslint-plugin-react-hooks false positive conditional call after foreach

1 participant