Skip to content

childrenProps

Reports usage of the children prop.

✅ This rule is included in the jsx stylistic presets.

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.

<
any
div
children: string
children
="Hello" />
<
const Component: any
Component
children: any
children
={<
any
span
>Test</
any
span
>} />;
<
any
button
children: string[]
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 ❤️‍🔥 around the world by the Flint team and contributors.