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