# React Hooks recommended

The Rules of Hooks, exhaustive dependencies and the React Compiler checks maintained by the React team.

- Linter: ESLint
- Package: `eslint-plugin-react-hooks` (https://react.dev/reference/eslint-plugin-react-hooks)
- Author: React team (official)
- Rules: 16
- Weekly downloads: 118.4M, +21.5% last quarter
- Technologies: react (16)

## Install

```sh
npm install -D eslint eslint-plugin-react-hooks
pnpm add -D eslint eslint-plugin-react-hooks
yarn add -D eslint eslint-plugin-react-hooks
bun add -d eslint eslint-plugin-react-hooks
```

## Config: `eslint.config.js`

```js
// eslint.config.js
import reactHooks from "eslint-plugin-react-hooks";

export default [
  reactHooks.configs.flat.recommended,
];
```

## Rules it enables

| Rule | Severity | Description | Reach |
| --- | --- | --- | --- |
| [react-hooks/exhaustive-deps](https://lintradar.dev/rules/react-hooks/exhaustive-deps.md) | warn | Verifies the list of dependencies for Hooks like useEffect and similar | 201.1M |
| [react-hooks/rules-of-hooks](https://lintradar.dev/rules/react-hooks/rules-of-hooks.md) | error | Enforces the Rules of Hooks | 201.1M |
| [react-hooks/error-boundaries](https://lintradar.dev/rules/react-hooks/error-boundaries.md) | error | Validates usage of error boundaries instead of try/catch for errors in child components | 165.2M |
| [react-hooks/globals](https://lintradar.dev/rules/react-hooks/globals.md) | error | Validates against assignment/mutation of globals during render, part of ensuring that side effects must render outside of render | 165.2M |
| [react-hooks/immutability](https://lintradar.dev/rules/react-hooks/immutability.md) | error | Validates against mutating props, state, and other values that are immutable | 165.2M |
| [react-hooks/incompatible-library](https://lintradar.dev/rules/react-hooks/incompatible-library.md) | warn | Validates against usage of libraries which are incompatible with memoization (manual or automatic) | 165.2M |
| [react-hooks/preserve-manual-memoization](https://lintradar.dev/rules/react-hooks/preserve-manual-memoization.md) | error | Validates 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 | 165.2M |
| [react-hooks/purity](https://lintradar.dev/rules/react-hooks/purity.md) | error | Validates that components/hooks are pure by checking that they do not call known-impure functions | 165.2M |
| [react-hooks/refs](https://lintradar.dev/rules/react-hooks/refs.md) | error | Validates correct usage of refs, not reading/writing during render. See the "pitfalls" section in `useRef()` usage | 165.2M |
| [react-hooks/set-state-in-effect](https://lintradar.dev/rules/react-hooks/set-state-in-effect.md) | error | Validates against calling setState synchronously in an effect. This can indicate non-local derived data, a derived event pattern, or improper external data synchronization. | 165.2M |
| [react-hooks/set-state-in-render](https://lintradar.dev/rules/react-hooks/set-state-in-render.md) | error | Validates against setting state during render, which can trigger additional renders and potential infinite render loops | 165.2M |
| [react-hooks/static-components](https://lintradar.dev/rules/react-hooks/static-components.md) | error | Validates that components are static, not recreated every render. Components that are recreated dynamically can reset state and trigger excessive re-rendering | 165.2M |
| [react-hooks/unsupported-syntax](https://lintradar.dev/rules/react-hooks/unsupported-syntax.md) | warn | Validates against syntax that we do not plan to support in React Compiler | 165.2M |
| [react-hooks/use-memo](https://lintradar.dev/rules/react-hooks/use-memo.md) | error | Validates usage of the useMemo() hook against common mistakes. See `useMemo()` docs for more information. | 165.2M |
| [react-hooks/config](https://lintradar.dev/rules/react-hooks/config.md) | error | Validates the compiler configuration options | 165.2M |
| [react-hooks/gating](https://lintradar.dev/rules/react-hooks/gating.md) | error | Validates configuration of gating mode | 165.2M |

---

Web page: https://lintradar.dev/presets/react-hooks-recommended. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
