Skip to content

Commit

Permalink
Update ExampleComponent.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
cfortuner authored Aug 10, 2023
1 parent 089c575 commit ab1d039
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/ExampleComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useEffect } from 'react';
const ExampleComponent = () => {
useEffect(() => {
console.log('ExampleComponent mounted');
}, []);
}, [dog]);

Check warning on line 6 in components/ExampleComponent.tsx

View workflow job for this annotation

GitHub Actions / Lint with ESLint and Prettier

React Hook useEffect has an unnecessary dependency: 'dog'. Either exclude it or remove the dependency array. Outer scope values like 'dog' aren't valid dependencies because mutating them doesn't re-render the component

return (
<div>
Expand All @@ -12,4 +12,4 @@ const ExampleComponent = () => {
);
}

export default ExampleComponent;
export default ExampleComponent;

0 comments on commit ab1d039

Please sign in to comment.