no-children-prop
Configuration
rslint.config.ts
Rule Details
Children should always be actual children, not passed in as a prop.
When using JSX, the children should be nested between the opening and closing tags. When not using JSX, the children should be passed as additional arguments to React.createElement.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Rule Options
allowFunctions
Default: false.
When enabled, function children are required to be passed as the children prop rather than nested between tags or passed as an additional React.createElement argument. This can be useful for libraries that rely on render-callbacks.
Examples of correct code for this rule with { "allowFunctions": true }:
Examples of incorrect code for this rule with { "allowFunctions": true }: