This repository was archived by the owner on Oct 19, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 11module React
22 def self . render ( element , container )
33 container = `container.$$class ? container[0] : container`
4+
5+ cb = %x{
6+ function(){
7+ setTimeout(function(){
8+ #{ yield if block_given? }
9+ }, 0)
10+ }
11+ }
12+
413 if !( `typeof ReactDOM === 'undefined'` )
5- native = `ReactDOM.render(#{ element . to_n } , container, function(){ #{ yield if block_given? } } )` # v0.15+
14+ native = `ReactDOM.render(#{ element . to_n } , container, cb )` # v0.15+
615 elsif !( `typeof React.renderToString === 'undefined'` )
7- native = `React.render(#{ element . to_n } , container, function(){ #{ yield if block_given? } } )`
16+ native = `React.render(#{ element . to_n } , container, cb )`
817 else
918 raise "render is not defined. In React >= v15 you must import it with ReactDOM"
1019 end
1120
1221 if `#{ native } ._getOpalInstance !== undefined`
1322 `#{ native } ._getOpalInstance()`
14- elsif `React.findDOMNode !== undefined && #{ native } .nodeType == undefined`
23+ elsif `React.findDOMNode !== undefined && #{ native } .nodeType === undefined`
1524 `React.findDOMNode(#{ native } )`
1625 else
1726 native
You can’t perform that action at this time.
0 commit comments