Skip to content

Commit

Permalink
Update ExhaustiveDeps to only check experimental_useEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
poteto committed Sep 23, 2022
1 parent 9804d1a commit 16e669b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ const tests = {
{
code: normalizeIndent`
function MyComponent({ theme }) {
const onStuff = useEvent(() => {
const onStuff = experimental_useEvent(() => {
showNotification(theme);
});
useEffect(() => {
Expand Down Expand Up @@ -1642,7 +1642,7 @@ const tests = {
}, 1000);
return () => clearInterval(id);
}, [setCount]);
return <h1>{count}</h1>;
}
`,
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export default {
// useRef() return value is stable.
return true;
} else if (
(name === 'experimental_useEvent' || name === 'useEvent') &&
name === 'experimental_useEvent' &&
id.type === 'Identifier'
) {
// useEvent() return value is stable.
Expand Down

0 comments on commit 16e669b

Please sign in to comment.