# jsx-curly-newline

Rule `react/jsx-curly-newline`. Enforce consistent linebreaks in curly braces in JSX attributes and expressions

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `react/jsx-curly-newline` | no | safe | package `eslint-plugin-react` | [docs](https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-curly-newline.md) |

## Code examples

### Incorrect: the rule reports this

```jsx
<div>
  { foo
  }
</div>

<div>
  {
    foo }
</div>

<div>
  { foo &&
    foo.bar
  }
</div>
```

```jsx
<div>
  {
    foo &&
    foo.bar
  }
</div>

<div>
  {
    foo
  }
</div>

<div>
  { foo
  }
</div>
```

```jsx
<div>
  { foo &&
    foo.bar }
</div>

<div>
  { foo }
</div>

<div>
  { foo
  }
</div>
```

### Correct: the rule accepts this

```jsx
<div>
  { foo }
</div>

<div>
  {
    foo
  }
</div>
```

```jsx
<div>
  { foo &&
    foo.bar }
</div>

<div>
  { foo }
</div>
```

```jsx
<div>
  {
    foo &&
    foo.bar
  }
</div>

<div>
  {
    foo
  }
</div>
```

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-curly-newline": "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% |

## Related rules

- [react/jsx-closing-tag-location](https://lintradar.dev/rules/react/jsx-closing-tag-location.md): Enforce closing tag location for multiline JSX
- [react/jsx-curly-spacing](https://lintradar.dev/rules/react/jsx-curly-spacing.md): Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
- [react/jsx-closing-bracket-location](https://lintradar.dev/rules/react/jsx-closing-bracket-location.md): Enforce closing bracket location in JSX
- [react/jsx-equals-spacing](https://lintradar.dev/rules/react/jsx-equals-spacing.md): Enforce or disallow spaces around equal signs in JSX attributes
- [react/forbid-prop-types](https://lintradar.dev/rules/react/forbid-prop-types.md): Disallow certain propTypes
- [react/jsx-first-prop-new-line](https://lintradar.dev/rules/react/jsx-first-prop-new-line.md): Enforce proper position of the first property in JSX

---

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