2 ms·
the benefit for handleClick in a react codebase at least is, aside from convention, generally there will only be one click action per component and then you can
by bryanrasmussen 6y ago
the benefit for handleClick in a react codebase at least is, aside from convention, generally there will only be one click action per component and then you can see right when you come into the component - hey there is a click somewhere in this component.
In that case what I find preferable is onClick => handleClick()
handleClick = () => {
stuff in handle click
updateDate();
}
on edit: I see lots of others made same point one node lower.