Skip to content

Instantly share code, notes, and snippets.

@netsi1964
Created Aug 22, 2017
Embed
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 />')}} />
@netsi1964
Copy link
Author

netsi1964 commented Aug 22, 2017

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

@juanonsoftware
Copy link

juanonsoftware commented Aug 17, 2018

Thanks !

@fpigeonjr
Copy link

fpigeonjr commented Aug 17, 2018

Thanks! Worked for me.

@vedovato
Copy link

vedovato commented Jun 20, 2020

yay it works, thanks!

@RogerMoreno
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