Open catmando opened 6 years ago
if you say for example: MyRubyComponent().on(:change) then MyRubyComponent will receive a onChange param. But if you say MyRubyComponent().on(:foo_bar) then MyRubyComponent will receive a on_foo_bar param.
MyRubyComponent().on(:change)
onChange
MyRubyComponent().on(:foo_bar)
on_foo_bar
See https://github.com/ruby-hyperloop/hyper-react/blob/dc90b8444f5a64831e6d9f21c280b0b7afab8b34/lib/react/element.rb#L122
For why.
The reason this is done is that MyRubyComponent can pass all_other_params on to components nested within it, and the event names will follow along.
all_other_params
Perhaps rethinking the entire param interface between ruby and native components could yield a more consistent solution.
if you say for example:
MyRubyComponent().on(:change)
then MyRubyComponent will receive aonChange
param. But if you sayMyRubyComponent().on(:foo_bar)
then MyRubyComponent will receive aon_foo_bar
param.See https://github.com/ruby-hyperloop/hyper-react/blob/dc90b8444f5a64831e6d9f21c280b0b7afab8b34/lib/react/element.rb#L122
For why.
The reason this is done is that MyRubyComponent can pass
all_other_params
on to components nested within it, and the event names will follow along.Perhaps rethinking the entire param interface between ruby and native components could yield a more consistent solution.