It'd be super cool if all event handlers were named great, but this rule presents a problem when passing down action creators.
With the rule enforced, onChangeText={this.props.actions.credentials.setUserEmail} is an error. It would expect it to be onChangeText={this.props.actions.credentials.handleSetUserEmail}, which is kind of a crappy name for an action creator (they should be named for what they do, not what they handle -- there isn't necessarily any link between an action creator and what event fires to call that method).
Enforcing a method named handleSetUserEmail that was specific to this component would be very cool (like onChangeText={this.handleSetUserEmail}), but it isn't an option to have it not apply to methods that were passed down from another function.
What changed?
Removed this oppressive rule and made linting great again!
Why?
It'd be super cool if all event handlers were named great, but this rule presents a problem when passing down action creators.
With the rule enforced,
onChangeText={this.props.actions.credentials.setUserEmail}
is an error. It would expect it to beonChangeText={this.props.actions.credentials.handleSetUserEmail}
, which is kind of a crappy name for an action creator (they should be named for what they do, not what they handle -- there isn't necessarily any link between an action creator and what event fires to call that method).Enforcing a method named
handleSetUserEmail
that was specific to this component would be very cool (likeonChangeText={this.handleSetUserEmail}
), but it isn't an option to have it not apply to methods that were passed down from another function.What changed?