Sha256: 284cc241311192b7effeb2876b97e80da571b90c66e1e630486b2bcedf55bef1
Contents?: true
Size: 724 Bytes
Versions: 13
Compression:
Stored size: 724 Bytes
Contents
Element.instance_eval do def self.find(selector) selector = begin selector.dom_node rescue selector end if `#{selector}.$dom_node !== undefined` `$(#{selector})` end def self.[](selector) find(selector) end define_method :render do |container = nil, params = {}, &block| if `#{self.to_n}._reactrb_component_class === undefined` `#{self.to_n}._reactrb_component_class = #{Class.new(Hyperloop::Component)}` end klass = `#{self.to_n}._reactrb_component_class` klass.class_eval do render(container, params, &block) end React.render(React.create_element(`#{self.to_n}._reactrb_component_class`), self) end end if Object.const_defined?('Element')
Version data entries
13 entries across 13 versions & 1 rubygems