React Hooks
17 rules eslint-plugin-react-hooks@7.1.1
Complete effective rule inventory.
Rules
No enabled React Hooks rules match this search.
-
react-hooks/configValidates the compiler configuration options
-
react-hooks/error-boundariesValidates usage of error boundaries instead of try/catch for errors in child components
-
react-hooks/exhaustive-depsverifies the list of dependencies for Hooks like useEffect and similar
-
react-hooks/gatingValidates configuration of gating mode
-
react-hooks/globalsValidates against assignment/mutation of globals during render, part of ensuring that side effects must render outside of render
-
react-hooks/immutabilityValidates against mutating props, state, and other values that are immutable
-
react-hooks/incompatible-libraryValidates against usage of libraries which are incompatible with memoization (manual or automatic)
-
react-hooks/preserve-manual-memoizationValidates that existing manual memoized is preserved by the compiler. React Compiler will only compile components and hooks if its inference matches or exceeds the existing manual memoization
-
react-hooks/purityValidates that components/hooks are pure by checking that they do not call known-impure functions
-
react-hooks/refsValidates correct usage of refs, not reading/writing during render. See the "pitfalls" section in
useRef()usage -
react-hooks/rules-of-hooksenforces the Rules of Hooks
-
react-hooks/set-state-in-effectValidates against calling setState synchronously in an effect. This can indicate non-local derived data, a derived event pattern, or improper external data synchronization.
-
react-hooks/set-state-in-renderValidates against setting state during render, which can trigger additional renders and potential infinite render loops
-
react-hooks/static-componentsValidates that components are static, not recreated every render. Components that are recreated dynamically can reset state and trigger excessive re-rendering
-
react-hooks/unsupported-syntaxValidates against syntax that we do not plan to support in React Compiler
-
react-hooks/use-memoValidates usage of the useMemo() hook against common mistakes. See
useMemo()docs for more information. -
react-hooks/void-use-memoValidates that useMemos always return a value and that the result of the useMemo is used by the component/hook. See
useMemo()docs for more information.