Skip to content

Commit 65f2fcf

Browse files
committed
fix(eslint-plugin-react-hooks): accepting as expression as a callback (#28202)
## Summary Closes #20750 ## How did you test this change? Added a test case DiffTrain build for [2efa383](2efa383)
1 parent 7bfb304 commit 65f2fcf

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3d1da1f9ab7d54984c096e6a04c8729f3a50fd8a
1+
2efa38332adc1fc1500753d79fcba41a0197a7a6

compiled/facebook-www/eslint-plugin-react-hooks.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,6 +1892,11 @@ var ExhaustiveDeps = {
18921892
return;
18931893
// Handled
18941894

1895+
case 'TSAsExpression':
1896+
visitFunctionWithDependencies(callback.expression, declaredDependenciesNode, reactiveHook, reactiveHookName, isEffect);
1897+
return;
1898+
// Handled
1899+
18951900
case 'Identifier':
18961901
if (!declaredDependenciesNode) {
18971902
// No deps, no problems.

0 commit comments

Comments
 (0)