lib/react/element.rb
def merge_event_prop!(event_name, &block)
      if event_name =~ /^<(.+)>$/
        merge_component_event_prop! event_name.gsub(/^<(.+)>$/, '\1'), &block
      elsif React::Event::BUILT_IN_EVENTS.include?(name = "on#{event_name.event_camelize}")
        merge_built_in_event_prop! name, &block
      elsif @type.instance_variable_get('@native_import')
        merge_component_event_prop! name, &block
      else
        merge_deprecated_component_event_prop! event_name, &block
        merge_component_event_prop! "on_#{event_name}", &block
      end
    end
# built in events will have their event param translated to the Event wrapper
# and the name will camelcased and have on prefixed, so :click becomes onClick.
#
# events emitting from native components are assumed to have the same camel case and
# on prefixed.
#
# events emitting from reactrb components will just have on_ prefixed.  So
# :play_button_pushed attaches to the :on_play_button_pushed param
#
# in all cases the default name convention can be overriden by wrapping in <...> brackets.
# So on("<MyEvent>") will attach to the "MyEvent" param.
built in events will have their event param translated to the Event wrapper
and the name will camelcased and have on prefixed, so :click becomes onClick.

events emitting from native components are assumed to have the same camel case and
on prefixed.

events emitting from reactrb components will just have on_ prefixed.  So
:play_button_pushed attaches to the :on_play_button_pushed param

in all cases the default name convention can be overriden by wrapping in <...> brackets.
So on("") will attach to the "MyEvent" param.
built in events will have their event param translated to the Event wrapper and the name will camelcased and have on prefixed so : click becomes onClick . events emitting from native components are assumed to have the same camel case and on prefixed . events emitting from reactrb components will just have on_ prefixed . So : play_button_pushed attaches to the : on_play_button_pushed param in all cases the default name convention can be overriden by wrapping in < ... > brackets . So on ( " " ) will attach to the " MyEvent " param .
def merge_event_prop!(event_name, &block)
      if event_name =~ /^<(.+)>$/
        merge_component_event_prop! event_name.gsub(/^<(.+)>$/, '\1'), &block
      elsif React::Event::BUILT_IN_EVENTS.include?(name = "on#{event_name.event_camelize}")
        merge_built_in_event_prop! name, &block
      elsif @type.instance_variable_get('@native_import')
        merge_component_event_prop! name, &block
      else
        merge_deprecated_component_event_prop! event_name, &block
        merge_component_event_prop! "on_#{event_name}", &block
      end
    end
def merge_event_prop! ( event_name , & block ) if event_name =~ / ^<(.+)>$ / merge_component_event_prop! event_name . gsub ( / ^<(.+)>$ / , '\1' ) , & block elsif React :: Event :: BUILT_IN_EVENTS . include? ( name = "on#{event_name.event_camelize}" ) merge_built_in_event_prop! name , & block elsif @type . instance_variable_get ( '@native_import' ) merge_component_event_prop! name , & block else merge_deprecated_component_event_prop! event_name , & block merge_component_event_prop! "on_#{event_name}" , & block end end
built in events will have their event param translated to the Event wrapper
and the name will camelcased and have on prefixed, so :click becomes onClick.
built in events will have their event param translated to the Event wrapper and the name will camelcased and have on prefixed so : click becomes onClick .
event_name
block