lib/react/component/api.rb in isomorfeus-react-16.13.10 vs lib/react/component/api.rb in isomorfeus-react-16.13.11
- old
+ new
@@ -96,15 +96,16 @@
`Opal.React.render_buffer[Opal.React.render_buffer.length - 1].pop()`
end
end
alias gre get_react_element
- def method_ref(method_symbol)
+ def method_ref(method_symbol, *args)
+ method_key = "#{method_symbol}#{args}"
%x{
- if (#@native.method_refs && #@native.method_refs[#{method_symbol}]) { return #@native.method_refs[#{method_symbol}]; }
+ if (#@native.method_refs && #@native.method_refs[#{method_key}]) { return #@native.method_refs[#{method_key}]; }
if (!#@native.method_refs) { #@native.method_refs = {}; }
- #@native.method_refs[#{method_symbol}] = #{method(method_symbol)};
- return #@native.method_refs[#{method_symbol}];
+ #@native.method_refs[#{method_key}] = { m: #{method(method_symbol)}, a: args };
+ return #@native.method_refs[#{method_key}];
}
end
alias m_ref method_ref
def render_react_element(el)