Skip to content

Commit

Permalink
fix(eslint-plugin-react-hooks): accepting as expression as a callba…
Browse files Browse the repository at this point in the history
…ck (#28202)

## Summary

Closes #20750

## How did you test this change?

Added a test case

DiffTrain build for [2efa383](2efa383)
  • Loading branch information
eps1lon committed Feb 1, 2024
1 parent 7bfb304 commit 65f2fcf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3d1da1f9ab7d54984c096e6a04c8729f3a50fd8a
2efa38332adc1fc1500753d79fcba41a0197a7a6
5 changes: 5 additions & 0 deletions compiled/facebook-www/eslint-plugin-react-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -1892,6 +1892,11 @@ var ExhaustiveDeps = {
return;
// Handled

case 'TSAsExpression':
visitFunctionWithDependencies(callback.expression, declaredDependenciesNode, reactiveHook, reactiveHookName, isEffect);
return;
// Handled

case 'Identifier':
if (!declaredDependenciesNode) {
// No deps, no problems.
Expand Down

0 comments on commit 65f2fcf

Please sign in to comment.