Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,12 @@ const tests = {
},
{
code: normalizeIndent`
import * as React from 'react';
function App() {
if (shouldShowText) {
const text = use(query);
const data = React.use(thing);
const data2 = react.use(thing2);
return <Text text={text} />
}
return <Text text={shouldFetchBackupText ? use(backupQuery) : "Nothing to see here"} />
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-react-hooks/src/RulesOfHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function isUseEffectEventIdentifier(node) {
}

function isUseIdentifier(node) {
return node.type === 'Identifier' && node.name === 'use';
return isReactFunction(node, 'use');
}

export default {
Expand Down