Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

maintainability.ui

Prefer nested JSX children over the children prop

Passing `children` as a named prop is harder to read than composing elements between opening and closing tags.

#Metadata

Rule ID
ts.react.no-children-prop
Severity
low
Confidence
0.8
Languages
javascript, typescript
Presets
recommended, strict
Stability
experimental
Applies to
function
Tags
react, rules-catalog, ui

#Why it matters

Nested children match React composition idioms and keep component APIs consistent across the tree.

#Remediation

Place child elements between the component tags or accept `children` through normal function parameters without a JSX prop.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/typescript/ts.react.no-children-prop.rule.yaml.