cure53 / DOMPurify

DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:
https://cure53.de/purify
Other
13.61k stars 695 forks source link

[bag] - build error in react app #909

Closed Advicel closed 7 months ago

Advicel commented 7 months ago

[bag] - build error in react app

export 'sanitize' (imported as 'DOMPurify') was not found in 'dompurify' (module has no exports)

Background & Context

package.json:

"dompurify": "^3.0.8",

and import like this into the typescript file

import * as DOMPurify from 'dompurify';

<Text3 dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(item.text) }} />