Last active
August 29, 2015 14:23
-
-
Save chrisvfritz/dfe6ac8345887c88d82e to your computer and use it in GitHub Desktop.
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
window.$ = (element, propsOrChildren, childrenIfProps) -> | |
if (propsOrChildren? and propsOrChildren instanceof Array) or not (propsOrChildren instanceof Object) | |
props = null | |
children = propsOrChildren | |
else | |
props = propsOrChildren | |
children = childrenIfProps | |
React.createElement element, props, children | |
Object.keys(React.DOM).forEach (elementName) -> | |
window["$#{elementName}"] = (props, children) -> | |
$ elementName, props, children |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment