This repository was archived by the owner on Oct 19, 2018. It is now read-only.
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
dont rename component defined events for native components #153
Closed
Description
consider this example:
class MyComp < React::Component::Base
render do
MyOtherComp().on(:running) { alert 'MyOtherComp is running' }
end
end
the param name in MyOtherComp needs to be named _onRunning
for this to work.
React.js has the convention of naming call back props onFoo
, (so it mirrors any builtin event which have names like onChange
) and so we would naturally like to write .on(:foo) { ... }
This doesn't work because of the addition of the "_" in front.
So if the component being called is an imported native component DONT add the _