Alternatives to dangerouslySetInnerHTML

This page summarizes the projects mentioned and recommended in the original post on /r/reactjs

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • html-react-parser

    📝 HTML to React parser.

    I was thinking about some sanitization library but found this: https://github.com/remarkablemark/html-react-parser which i have reviewed to deeply yet.

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • 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:

    Use DOMPUrify. That plus dangerouslySetInnerHTML and you're good to go.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Displaying WYSIWYG editor's output with React

    2 projects | /r/webdev | 6 Jul 2022
  • Your rich text could be a cross-site scripting vulnerability

    3 projects | dev.to | 16 Dec 2024
  • Understanding Cross-Site Scripting (XSS): A Quick Reference

    1 project | dev.to | 28 Oct 2024
  • Mitigate XSS exploits when using React's `dangerously SetInnerHTML`

    1 project | dev.to | 12 Sep 2024
  • Navigating the Security Risks of Arbitrary Values in Tailwind CSS

    1 project | dev.to | 15 Aug 2024

Did you konow that JavaScript is
the 3rd most popular programming language
based on number of metions?