Last active
August 29, 2015 14:18
-
-
Save zetachang/abf76b110ac5c80bd4e9 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
module React | |
def self.create_element(klass) | |
%x{ | |
function ctor(){ | |
this.constructor = ctor | |
React.Component.apply(this, arguments); | |
klass._alloc.prototype.$initialize.call(this); | |
}; | |
ctor.prototype = klass._proto; | |
Object.assign(ctor.prototype, React.Component.prototype); | |
} | |
`React.createElement(ctor, null)` | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment