Rules
no-dangerously-set-innerhtml-with-children
Full Name in eslint-plugin-react-dom
Full Name in @eslint-react/eslint-plugin
Presets
domrecommendedrecommended-typescriptrecommended-type-checked
Description
Disallow dangerouslySetInnerHTML and children at the same time.
When using dangerouslySetInnerHTML, the content of the DOM element is set from the __html property. The content of the DOM element is completely replaced, so the children will not be rendered as expected.
Examples
Failing
Passing
Implementation
See Also
no-dangerously-set-innerhtml
Warns when usingdangerouslySetInnerHTML.no-void-elements-with-children
Prevents the use ofchildrenin void DOM elements.