Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.

fix: dependency warnings in useEffectHooks #21

Merged
merged 2 commits into from
Jan 13, 2023
Merged

Conversation

markphelps
Copy link
Contributor

Fix linter errors for useEffect deps

Before

> [email protected] lint
> eslint src


/Users/markphelps/workspace/flipt-ui/src/app/console/Console.tsx
  56:6  warning  React Hook useCallback has missing dependencies: 'clearError' and 'setError'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/markphelps/workspace/flipt-ui/src/app/flags/Evaluation.tsx
  105:6  warning  React Hook useCallback has a missing dependency: 'flag'. Either include it or remove the dependency array    react-hooks/exhaustive-deps
  159:6  warning  React Hook useEffect has a missing dependency: 'loadData'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/Users/markphelps/workspace/flipt-ui/src/app/flags/Flag.tsx
  45:6  warning  React Hook useCallback has missing dependencies: 'clearError', 'flag.key', and 'setError'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/markphelps/workspace/flipt-ui/src/app/flags/Flags.tsx
  23:6  warning  React Hook useEffect was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies  react-hooks/exhaustive-deps
  23:6  warning  React Hook useEffect has missing dependencies: 'clearError', 'error', and 'setError'. Either include them or remove the dependency array                              react-hooks/exhaustive-deps

/Users/markphelps/workspace/flipt-ui/src/app/segments/Segment.tsx
  63:6  warning  React Hook useCallback has missing dependencies: 'clearError', 'segment.key', and 'setError'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

/Users/markphelps/workspace/flipt-ui/src/app/segments/Segments.tsx
  23:6  warning  React Hook useEffect was passed a dependency list that is not an array literal. This means we can't statically verify whether you've passed the correct dependencies  react-hooks/exhaustive-deps
  23:6  warning  React Hook useEffect has missing dependencies: 'clearError', 'error', and 'setError'. Either include them or remove the dependency array                              react-hooks/exhaustive-deps

✖ 9 problems (0 errors, 9 warnings)

After

> [email protected] lint
> eslint src

Copy link
Contributor

@darinmclain darinmclain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@markphelps markphelps enabled auto-merge (squash) January 13, 2023 12:18
@markphelps markphelps merged commit 8026605 into main Jan 13, 2023
@markphelps markphelps deleted the fix-useeffect-deps branch January 13, 2023 12:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants