Skip to content

Instantly share code, notes, and snippets.

@lucasdu4rte
Created June 5, 2018 03:24
Show Gist options
  • Save lucasdu4rte/bd8fd1a5af3d449f1a851c3adf2f649a to your computer and use it in GitHub Desktop.
Save lucasdu4rte/bd8fd1a5af3d449f1a851c3adf2f649a to your computer and use it in GitHub Desktop.
render JSX to HTMLText
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