The ordering section implies that event handlers should be named onFoo rather than handleFoo per FB examples. Is this an explicit rule? If so, it would be nice to have it listed in either the "naming" or "methods" sections.
Any update?
It's worth noting this was briefly discussed in this PR: https://github.com/airbnb/javascript/pull/619
Interesting – I think it makes sense to name handlers according to what they do, though; makes it easier to see at a glance what is going on without having to check render(). In other words,
class PokePlayerButton extends React.Component {
/* ... */
onClick() {
this.props.pokePlayer();
}
/* ... */
}
Otherwise it's harder to tell what's actually the click handler without looking at the source of render().
I'm wondering if there's been any changes here – onFoo, handleFoo, "use an appropriate verb-based clause", or something else, especially given that the rule set still includes sort-comp.
Any updates here?
Most helpful comment
I'm wondering if there's been any changes here –
onFoo,handleFoo, "use an appropriate verb-based clause", or something else, especially given that the rule set still includes sort-comp.