lib/react/component/api.rb in isomorfeus-react-16.12.11 vs lib/react/component/api.rb in isomorfeus-react-16.12.12

- old
+ new

@@ -84,11 +84,11 @@ let last_buffer_length = Opal.React.render_buffer[Opal.React.render_buffer.length - 1].length; let last_buffer_element = Opal.React.render_buffer[Opal.React.render_buffer.length - 1][last_buffer_length - 1]; block.$call(); // console.log("get_react_element popping", Opal.React.render_buffer, Opal.React.render_buffer.toString()) let new_element = Opal.React.render_buffer[Opal.React.render_buffer.length - 1].pop(); - if (last_buffer_element === new_element) { #{raise "Block did not create any React element!"} } + if (last_buffer_element === new_element) { #{Isomorfeus.raise_error(message: "Block did not create any React element!")} } return new_element; } else # element was rendered before being passed as arg # fetch last element from buffer @@ -104,9 +104,10 @@ if (!#@native.method_refs) { #@native.method_refs = {}; } #@native.method_refs[#{method_symbol}] = #{method(method_symbol)}; return #@native.method_refs[#{method_symbol}]; } end + alias m_ref method_ref def render_react_element(el) # push el to buffer `Opal.React.render_buffer[Opal.React.render_buffer.length - 1].push(el)` # `console.log("render_react_element pushed", Opal.React.render_buffer, Opal.React.render_buffer.toString())`