# jsx-key

Rule `react/jsx-key`. Disallow missing `key` props in iterators/collection literals

- Source: react
- Technologies: React
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 158.5M weekly downloads of presets that enable it
- Trend: +48.7% last quarter
- Rank: #111 by reach, #855 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `react/jsx-key` | yes | no | package `eslint-plugin-react` | [docs](https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-key.md) |
| Oxlint | `react/jsx-key` | no | no | plugin `react`, category correctness | [docs](https://oxc.rs/docs/guide/usage/linter/rules/react/jsx-key.html) |
| Biome | `correctness/useJsxKeyInIterable` | yes | no | group correctness, since 1.6.0 | [docs](https://biomejs.dev/linter/rules/use-jsx-key-in-iterable/) |

## Code examples

### Incorrect: the rule reports this

```jsx
[<Hello />, <Hello />, <Hello />];
```

```jsx
data.map(x => <Hello>{x}</Hello>);
```

```jsx
Array.from([1, 2, 3], (x) => <Hello>{x}</Hello>);
```

### Correct: the rule accepts this

```jsx
[<Hello key="first" />, <Hello key="second" />, <Hello key="third" />];
```

```jsx
data.map((x) => <Hello key={x.id}>{x}</Hello>);
```

```jsx
Array.from([1, 2, 3], (x) => <Hello key={x}>{x}</Hello>);
```

Examples from the ESLint documentation.

## Enable it

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

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

export default [
  {
    plugins: { react },
    rules: {
      "react/jsx-key": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "react"
  ],
  "rules": {
    "react/jsx-key": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "correctness": {
        "useJsxKeyInIterable": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [React recommended](https://lintradar.dev/presets/react-recommended.md) | ESLint | `eslint-plugin-react` | 21 | 81.1M | +34.1% |
| [Next.js Core Web Vitals](https://lintradar.dev/presets/next-core-web-vitals.md) | ESLint | `eslint-config-next` | 62 | 46.8M | +48.8% |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Alloy](https://lintradar.dev/presets/alloy.md) | ESLint | `eslint-config-alloy` | 166 | 31.4K | +32.4% |

## Related rules

- [react/no-render-return-value](https://lintradar.dev/rules/react/no-render-return-value.md): Disallow usage of the return value of ReactDOM.render
- [react/no-children-prop](https://lintradar.dev/rules/react/no-children-prop.md): Disallow passing of children as props
- [react/no-string-refs](https://lintradar.dev/rules/react/no-string-refs.md): Disallow using string references
- [react/jsx-no-undef](https://lintradar.dev/rules/react/jsx-no-undef.md): Disallow undeclared variables in JSX
- [react/no-is-mounted](https://lintradar.dev/rules/react/no-is-mounted.md): Disallow usage of isMounted
- [react/require-render-return](https://lintradar.dev/rules/react/require-render-return.md): Enforce ES5 or ES6 class for returning value in render function

---

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