Skip to main content

no-danger

Prevent the use of dangerouslySetInnerHTML which can lead to XSS vulnerabilities if used incorrectly.

Invalid:

const hello = <div dangerouslySetInnerHTML={{ __html: "Hello World!" }} />;

Valid:

const hello = <div>Hello World!</div>;

Did you find what you needed?

Privacy policy