Skip to content
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
@catmando

Description

@catmando

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 _

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions