# no-react-children

Rule `react/no-react-children`. Disallows the usage of `React.Children`, as it is considered a bad practice.

- Source: react
- Technologies: React
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1897 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Oxlint | `react/no-react-children` | no | no | plugin `react`, category restriction | [docs](https://oxc.rs/docs/guide/usage/linter/rules/react/no-react-children.html) |

## Code examples

### Incorrect: the rule reports this

```jsx
import { Children } from 'react';

Children.toArray(children);
Children.map(children, child => <div>{child}</div>);
Children.only(children);
Children.count(children);
Children.forEach(children, (child, index) => {});
```

```jsx
import React from 'react';

function Table({ children }) {
  const mappedChildren = React.Children.map(children, (child) =>
    <tr>{child}</tr>
  );

  return <table>{mappedChildren}</table>;
}
```

```jsx
import { Children } from 'react';

function RowList({ children }) {
  return (
    <>
      <h1>Total rows: {Children.count(children)}</h1>
    </>
  );
}
```

### Correct: the rule accepts this

```jsx
function Card({ children }) {
  return (
    <div className="card">
      {children}
    </div>
  );
}
```

Examples from the Oxlint documentation.

## Enable it

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "react"
  ],
  "rules": {
    "react/no-react-children": "error"
  }
}
```

## Related rules

- [react/no-clone-element](https://lintradar.dev/rules/react/no-clone-element.md): Prevents the usage of `React.cloneElement`, which is considered an anti-pattern in React.
- [react/only-export-components](https://lintradar.dev/rules/react/only-export-components.md): Ensures that modules only **export React components (and related HMR-safe items)** so that Fast Refresh (a.k.a. hot reloading) can safely preserve component state. Concretely, it validates the shape of your module’s exports and common entrypoints (e.g. `createRoot(...).render(<App />)`) to match what integrations like `react-refresh` expect.
- [react/prefer-function-component](https://lintradar.dev/rules/react/prefer-function-component.md): Enforces that React components are written as function components instead of class components.
- [react/sort-prop-types](https://lintradar.dev/rules/react/sort-prop-types.md): Enforce propTypes declarations alphabetical sorting
- [react/sort-default-props](https://lintradar.dev/rules/react/sort-default-props.md): Enforce defaultProps declarations alphabetical sorting
- [react/require-optimization](https://lintradar.dev/rules/react/require-optimization.md): Enforce React components to have a shouldComponentUpdate method

---

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