Skip to content

Instantly share code, notes, and snippets.

@thebiltheory
Created May 31, 2019 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thebiltheory/ab38d6c6cebca1179231292d99acc5e6 to your computer and use it in GitHub Desktop.
Save thebiltheory/ab38d6c6cebca1179231292d99acc5e6 to your computer and use it in GitHub Desktop.
import parse from "html-react-parser";
import DOMPurify from "dompurify";
export default function parseHtml(response) {
if (response) {
const dirty = response;
const clean = DOMPurify.sanitize(dirty);
return parse(clean);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment