Skip to content

Instantly share code, notes, and snippets.

@netsi1964
Created August 22, 2017 06:30
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netsi1964/d140318308e3ec5fd231a800400892e9 to your computer and use it in GitHub Desktop.
Save netsi1964/d140318308e3ec5fd231a800400892e9 to your computer and use it in GitHub Desktop.
RawHTML: ReactJS pure component to render HTML
const RawHTML = ({children, className = ""}) =>
<div className={className} dangerouslySetInnerHTML={{ __html: children.replace(/\n/g, '<br />')}} />
@RogerMoreno
Copy link

Thanks! Worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment