# hook-use-state

Rule `react/hook-use-state`. Ensure destructuring and symmetric naming of useState hook value and setter variables

- Source: react
- Technologies: React
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1721 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `react/hook-use-state` | no | suggestion | package `eslint-plugin-react` | [docs](https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/hook-use-state.md) |
| Oxlint | `react/hook-use-state` | no | no | plugin `react`, category style | [docs](https://oxc.rs/docs/guide/usage/linter/rules/react/hook-use-state.html) |

## Code examples

### Incorrect: the rule reports this

```js
import React from 'react';
export default function useColor() {
  // useState call is not destructured into value + setter pair
  const useStateResult = React.useState();
  return useStateResult;
}
```

```js
import React from 'react';
export default function useColor() {
  // useState call is destructured into value + setter pair, but identifier
  // names do not follow the [thing, setThing] naming convention
  const [color, updateColor] = React.useState();
  return [color, updateColor];
}
```

### Correct: the rule accepts this

```js
import React from 'react';
export default function useColor() {
  // useState call is destructured into value + setter pair whose identifiers
  // follow the [thing, setThing] naming convention
  const [color, setColor] = React.useState();
  return [color, setColor];
}
```

```js
import React from 'react';
export default function useColor() {
  // useState result is directly returned
  return React.useState();
}
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import react from "eslint-plugin-react";

export default [
  {
    plugins: { react },
    rules: {
      "react/hook-use-state": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "react"
  ],
  "rules": {
    "react/hook-use-state": "error"
  }
}
```

## Related rules

- [react/forward-ref-uses-ref](https://lintradar.dev/rules/react/forward-ref-uses-ref.md): Require all forwardRef components include a ref parameter
- [react/jsx-handler-names](https://lintradar.dev/rules/react/jsx-handler-names.md): Enforce event handler naming conventions in JSX
- [react/forbid-dom-props](https://lintradar.dev/rules/react/forbid-dom-props.md): Disallow certain props on DOM Nodes
- [react/jsx-max-depth](https://lintradar.dev/rules/react/jsx-max-depth.md): Enforce JSX maximum depth
- [react/forbid-component-props](https://lintradar.dev/rules/react/forbid-component-props.md): Disallow certain props on components
- [react/no-multi-comp](https://lintradar.dev/rules/react/no-multi-comp.md): Disallow multiple component definition per file

---

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