Last active
January 9, 2020 23:40
-
-
Save orodio/905674a56865216c675c230f9688eaa3 to your computer and use it in GitHub Desktop.
dirtyInject
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 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