Created
June 5, 2018 03:24
-
-
Save lucasdu4rte/bd8fd1a5af3d449f1a851c3adf2f649a to your computer and use it in GitHub Desktop.
render JSX to HTMLText
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const renderText = (component) => { | |
const __a = document.createElement('div') | |
ReactDOM.render(component, __a) | |
const _el = __a.outerHTML | |
ReactDOM.unmountComponentAtNode(__a) | |
return _el | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment