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 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 juanonsoftware commented Aug 17, 2018

Thanks !

@fpigeonjr

This comment has been minimized.

Copy link

@fpigeonjr fpigeonjr commented Aug 17, 2018

Thanks! Worked for me.

@vedovato

This comment has been minimized.

Copy link

@vedovato vedovato commented Jun 20, 2020

yay it works, thanks!

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.