Skip to content

No error checking for binding an event to a missing handler #354

@toddself

Description

@toddself

Most other javascript libraries for building UIs provide some sort of feedback, thrown error or other notification when trying to bind an event to a missing handler, however react just merely does nothing.

Example:

var TestNode = React.createClass({
    handleClick: function(){
        console.log('i will never get called, but no error will occur');
    },
    render: function(){
        return <input type="submit" onClick={this.handleclick} value="test" />
    }
});

React.renderComponent(<TestNode />, document.body);

Since the onClick isn't camelCased, this will not work obviously, however, no errors will be generated.

Would love to see the binding mechanism explain that the handler is non-existent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions