Skip to content

childrenProps

Reports usage of the children prop.

✅ This rule is included in the jsx stylistic preset.

In JSX, children are generally intended to be passed as content between opening and closing tags rather than as a children prop. This makes the JSX more readable and maintainable by following the standard JSX pattern.

<div children="Hello" />
<Component children={<span>Test</span>} />
<button children={["Click me"]} />

If you prefer the consistency of always using named props including children over aligning with common JSX conventions, you might prefer to disable this rule.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.