Skip to content

Instantly share code, notes, and snippets.

@netsi1964
Created August 22, 2017 06:30
Show Gist options
  • 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 />')}} />
@fpigeonjr
Copy link

Thanks! Worked for me.

@vedovato
Copy link

yay it works, thanks!

@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