I know I can bind this
in a couple of different ways in react like these:
<button onClick={this.onSelect.bind(this, data)}>Button</button>
or
<button onClick={() => this.onSelect(data)}>Button</button>
or
constructor(props) {
super(props);
this.onSelect= this.onSelect.bind(this)
}
<button onClick={this.onSelect}>Button</button>
The problem is that I cannot send data using third option. Is there anyway to use the third option and send data as well?