Skip to content

Instantly share code, notes, and snippets.

@netsi1964 netsi1964/RawHTML.js
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

This comment has been minimized.

Copy link
Owner Author

netsi1964 commented Aug 22, 2017

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

@juanonsoftware

This comment has been minimized.

Copy link

juanonsoftware commented Aug 17, 2018

Thanks !

@fpigeonjr

This comment has been minimized.

Copy link

fpigeonjr commented Aug 17, 2018

Thanks! Worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.