Skip to content

Instantly share code, notes, and snippets.

Created Aug 22, 2017
What would you like to do?
RawHTML: ReactJS pure component to render HTML
const RawHTML = ({children, className = ""}) =>
<div className={className} dangerouslySetInnerHTML={{ __html: children.replace(/\n/g, '<br />')}} />
Copy link

netsi1964 commented Aug 22, 2017

In an answer to a question on StackOverflow you can get more info

Copy link

juanonsoftware commented Aug 17, 2018

Thanks !

Copy link

fpigeonjr commented Aug 17, 2018

Thanks! Worked for me.

Copy link

vedovato commented Jun 20, 2020

yay it works, thanks!

Copy link

RogerMoreno commented Mar 5, 2022

Thanks! Worked for me.

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