# jsx-fragments

Rule `react/jsx-fragments`. Enforce shorthand or standard form for React fragments

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `react/jsx-fragments` | no | safe | package `eslint-plugin-react` | [docs](https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-fragments.md) |
| Oxlint | `react/jsx-fragments` | no | safe | plugin `react`, category style | [docs](https://oxc.rs/docs/guide/usage/linter/rules/react/jsx-fragments.html) |
| Biome | `style/useFragmentSyntax` | no | unsafe | group style, since 1.0.0 | [docs](https://biomejs.dev/linter/rules/use-fragment-syntax/) |

## Code examples

### Incorrect: the rule reports this

```jsx
<React.Fragment><Foo /></React.Fragment>
```

```jsx
<><Foo /></>
```

### Correct: the rule accepts this

```jsx
<><Foo /></>
```

```jsx
<React.Fragment key="key"><Foo /></React.Fragment>
```

```jsx
<React.Fragment><Foo /></React.Fragment>
```

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-fragments": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

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

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "useFragmentSyntax": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [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/jsx-no-bind](https://lintradar.dev/rules/react/jsx-no-bind.md): Disallow `.bind()` or arrow functions in JSX props
- [react/jsx-filename-extension](https://lintradar.dev/rules/react/jsx-filename-extension.md): Disallow file extensions that may contain JSX
- [react/no-did-update-set-state](https://lintradar.dev/rules/react/no-did-update-set-state.md): Disallow usage of setState in componentDidUpdate
- [react/no-unstable-nested-components](https://lintradar.dev/rules/react/no-unstable-nested-components.md): Disallow creating unstable components inside components
- [react/jsx-curly-brace-presence](https://lintradar.dev/rules/react/jsx-curly-brace-presence.md): Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes
- [react/jsx-no-script-url](https://lintradar.dev/rules/react/jsx-no-script-url.md): Disallow usage of `javascript:` URLs

---

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