# jsx-no-leaked-render

Rule `react/jsx-no-leaked-render`. Disallow problematic leaked values from being rendered

- Source: react
- Technologies: React
- Kind: suspicious
- 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: #1732 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `react/jsx-no-leaked-render` | no | safe | package `eslint-plugin-react` | [docs](https://github.com/jsx-eslint/eslint-plugin-react/tree/master/docs/rules/jsx-no-leaked-render.md) |
| Biome | `suspicious/noLeakedRender` | no | no | group suspicious, since 2.3.8 | [docs](https://biomejs.dev/linter/rules/no-leaked-render/) |

## Code examples

### Incorrect: the rule reports this

```jsx
const Component = ({ count, title }) => {
  return <div>{count && title}</div>
}
```

```jsx
const Component = ({ count }) => {
  return <div>{count && <span>There are {count} results</span>}</div>
}
```

```jsx
const Component = ({ elements }) => {
  return <div>{elements.length && <List elements={elements} />}</div>
}
```

### Correct: the rule accepts this

```jsx
const Component = ({ elements }) => {
  return <div>{elements}</div>
}
```

```jsx
// An OR condition it's considered valid since it's assumed as a way
// to render some fallback if the first value is falsy, not to render something conditionally.
const Component = ({ customTitle }) => {
  return <div>{customTitle || defaultTitle}</div>
}
```

```jsx
const Component = ({ elements }) => {
  return <div>There are {elements.length} elements</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-no-leaked-render": "error",
    },
  },
];
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "suspicious": {
        "noLeakedRender": "error"
      }
    }
  }
}
```

## Related rules

- [sonarjs/jsx-no-leaked-render](https://lintradar.dev/rules/sonarjs/jsx-no-leaked-render.md): React components should not render non-boolean condition values
- [react/no-set-state](https://lintradar.dev/rules/react/no-set-state.md): Disallow usage of setState
- [react/no-multi-comp](https://lintradar.dev/rules/react/no-multi-comp.md): Disallow multiple component definition per file
- [react/jsx-max-depth](https://lintradar.dev/rules/react/jsx-max-depth.md): Enforce JSX maximum depth
- [react/jsx-handler-names](https://lintradar.dev/rules/react/jsx-handler-names.md): Enforce event handler naming conventions in JSX
- [react/hook-use-state](https://lintradar.dev/rules/react/hook-use-state.md): Ensure destructuring and symmetric naming of useState hook value and setter variables

---

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