Skip to content

Commit

Permalink
Maybe the experimental flag isn't worth it
Browse files Browse the repository at this point in the history
  • Loading branch information
poteto committed Sep 16, 2022
1 parent 1fae1ad commit 777fa9c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,18 +222,15 @@ export default {
}
const id = def.node.id;
const {name} = callee;
if (__EXPERIMENTAL__) {
if (
(name === 'experimental_useEvent' || name === 'useEvent') &&
id.type === 'Identifier'
) {
// useEvent() return value is stable.
return true;
}
}
if (name === 'useRef' && id.type === 'Identifier') {
// useRef() return value is stable.
return true;
} else if (
(name === 'experimental_useEvent' || name === 'useEvent') &&
id.type === 'Identifier'
) {
// useEvent() return value is stable.
return true;
} else if (name === 'useState' || name === 'useReducer') {
// Only consider second value in initializing tuple stable.
if (
Expand Down

0 comments on commit 777fa9c

Please sign in to comment.