Last active
September 3, 2018 10:34
-
-
Save heypoom/9f239a5ced1739219aa18b8c1840df8e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 createElement = React.createElement | |
React.createElement = (element, props, children, ...args) => { | |
// Fancy Logging for React Element Creation | |
const _props = props ? Object.entries(props).map(([k, v]) => `${k}=${JSON.stringify(v)}`).join(' ') : '' | |
console.log(`Creating %c<${element} %c${_props} %c/>`, 'color: teal; font-weight: bold', 'color: #777', 'color: teal') | |
// TODO: Monkey Patch your code here. | |
return createElement(element, props, children, ...args) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment