Skip to content

Instantly share code, notes, and snippets.

@zetachang
Last active August 29, 2015 14:18
Show Gist options
  • Save zetachang/abf76b110ac5c80bd4e9 to your computer and use it in GitHub Desktop.
Save zetachang/abf76b110ac5c80bd4e9 to your computer and use it in GitHub Desktop.
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