Skip to content

Instantly share code, notes, and snippets.

@orodio
Last active January 9, 2020 23:40
Show Gist options
  • Save orodio/905674a56865216c675c230f9688eaa3 to your computer and use it in GitHub Desktop.
Save orodio/905674a56865216c675c230f9688eaa3 to your computer and use it in GitHub Desktop.
dirtyInject
const root =
(typeof self === 'object' && self.self === self && self) ||
(typeof global === 'object' && global.global === global && global) ||
(typeof window === 'object' && window.window === window && window) ||
this
root.__RAWR__ = {
onMount: (domNode, props) => {
// ReactDOM.render(<Counter {...props} />, domNode)
domNode.innerHTML = `<div>
<h1>Hello From The Other Side!!!</h1>
<code>
<pre>${JSON.stringify(props, null, 2)}</pre>
</code>
</div>`
},
onUnmount: (domNode, props) => {
// ReactDOM.unmountComponentAtNode(domNode)
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment