Rules
react/no-children-map

react/no-children-map

Rule category

Restriction.

What it does

Prevents usage of Children.map.

Why is this bad?

Using Children is uncommon and can lead to fragile code. See common alternatives (opens in a new tab).

Examples

❌ Incorrect

import { Children } from "react";
 
function RowList({ children }) {
  return (
    <div className="RowList">
      {Children.map(children, child => (
        <div className="Row">
          {child}
        </div>
      ))}
    </div>
  );
}

Further reading