Sha256: bf451be749d9091dcf7a1fbb458575316cc6129c43f9051e588949c221e1828f
Contents?: true
Size: 857 Bytes
Versions: 5
Compression:
Stored size: 857 Bytes
Contents
module React def self.render(element, container) raise "ReactDOM.render is not defined. In React >= v15 you must import it with ReactDOM" if (`typeof ReactDOM === 'undefined'`) container = `container.$$class ? container[0] : container` if block_given? cb = %x{ function(){ setTimeout(function(){ #{yield} }, 0) } } native = `ReactDOM.render(#{element.to_n}, container, cb)` else native = `ReactDOM.render(#{element.to_n}, container)` end return unless `#{native} !== null` if `#{native}.__opalInstance !== undefined && #{native}.__opalInstance !== null` `#{native}.__opalInstance` elsif `ReactDOM.findDOMNode !== undefined && #{native}.nodeType === undefined` `ReactDOM.findDOMNode(#{native})` else native end end end
Version data entries
5 entries across 5 versions & 1 rubygems