(In React Coding) Whenever I click on the screen I would like to compute something by using OnClick
event. For that I got a sample code from internet as follows,
<div className="sample" onClick={this.handleClick.bind(this)}>
The handleClick
method and <div>
resides in the same method. Could anybody explain why binding is required here and why should not we call handleClick()
method directly with out binding?