Skip to content

Ignore type parameters in exhaustive-deps captures#36414

Open
raashish1601 wants to merge 1 commit intofacebook:mainfrom
raashish1601:codex/exhaustive-deps-ignore-type-parameters
Open

Ignore type parameters in exhaustive-deps captures#36414
raashish1601 wants to merge 1 commit intofacebook:mainfrom
raashish1601:codex/exhaustive-deps-ignore-type-parameters

Conversation

@raashish1601
Copy link
Copy Markdown

Summary

  • Fix exhaustive-deps so TypeScript/Flow type-only references inside helper functions are not treated as render captures.
  • Add a TypeScript regression test for a stable helper that reads a ref and mentions a generic type parameter.

Fixes #25149.

Test plan

  • corepack yarn --cwd packages/eslint-plugin-react-hooks jest ESLintRuleExhaustiveDeps-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: react-hooks/exhaustive-deps false positive when use function with generic type variable in useEffect

1 participant