Skip to content

Commit 7adeb4a

Browse files
committed
[lint] treat React.use() the same as use() (#27769)
We should probably treat `React.use()` the same as `use()` to allow it within loops and conditionals. Ideally this would implement a test that `React` is imported or required from `'react'`, but we don't otherwise implement such a test. DiffTrain build for [640cceb](640cceb)
1 parent c35082f commit 7adeb4a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5dd35968bef791ccc5948c657fabf191a77fff3f
1+
640ccebb7d9669f1efbd20e86f6f84086c3d698d

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ function isUseEffectEventIdentifier$1(node) {
169169
}
170170

171171
function isUseIdentifier(node) {
172-
return node.type === 'Identifier' && node.name === 'use';
172+
return isReactFunction(node, 'use');
173173
}
174174

175175
var RulesOfHooks = {

0 commit comments

Comments
 (0)