react/no-children-only
Rule category
Restriction.
What it does
Prevents usage of Children.only
.
Why is this bad?
Using Children
is uncommon and can lead to fragile code. See common alternatives (opens in a new tab).
Examples
❌ Incorrect
function Box({ children }) {
const element = Children.only(children);
// ...
}