dillon1000/react

Commit

[eslint] Consider `useRef() as ...` as constant (#18496)

Sometimes you need to use casts, eg: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/28884#issuecomment-471341041. This change ignores them and allows you to still omit the ref object from the deps list.

Test Plan: unit tests
Browse files
Changed paths4 files
First-parent comparison
M packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js ModifiedM packages/eslint-plugin-react-hooks/package.json ModifiedM packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js ModifiedM yarn.lock Modified
Patch

Files changed

Rendering syntax-highlighted changes…