Alternatives to dangerouslySetInnerHTML

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

Our great sponsors
  • Amplication - open-source Node.js backend code generator
  • Appwrite - The open-source backend cloud platform
  • SurveyJS - A Non-Cloud Alternative to Google Forms that has it all.
  • Sonar - Write Clean JavaScript Code. Always.
  • InfluxDB - Collect and Analyze Billions of Data Points in Real Time
  • Mergify - Tired of breaking your main and manually rebasing outdated pull requests?
  • html-react-parser

    :memo: 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.

  • 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.

  • Amplication

    Amplication: open-source Node.js backend code generator. An open-source platform that helps developers build backends without spending time on boilerplate & repetitive coding. Including production-ready GraphQL & REST APIs, DB schema, DTOs, filtering, pagination, RBAC, & more.

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