JavaScript

JavaScript

Made by DeepSource

Prefer event handler naming conventions in JSX JS-0411

Anti-pattern
Minor
react

Ensures that any component or prop methods used to handle events are correctly prefixed.

Bad Practice

<MyComponent handleChange={this.handleChange} />

// Example 2
<MyComponent onChange={this.componentChanged} />

Recommended

<MyComponent onChange={this.handleChange} />

// Example 2
<MyComponent onChange={this.props.onFoo} />