React HTML Sanitizer Parser
JSON →The `react-sanitizer-parser` package is a React component and utility library designed to safely render HTML content within React applications, mitigating XSS vulnerabilities. It acts as a convenient wrapper around two well-established libraries: `html-react-parser` for converting HTML strings into React elements and `DOMPurify` for robust HTML sanitization. As of version 0.1.4, it provides a `<ReactSanitizerParser>` component that takes a `dirty` HTML string as children, along with optional `htmlParserOptions` and `sanitizerConfig` props to fine-tune the behavior of its underlying dependencies. Additionally, it re-exports the `parse` function from `html-react-parser` and the `DOMPurify` object directly for more granular, imperative usage. Its primary differentiator is simplifying the integration of HTML parsing and sanitization into React, offering a streamlined API compared to configuring both libraries independently.
Traffic · last 30 days ↑0% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇬🇧 United Kingdom · 🇨🇳 China