Passing Arguments

Passing an extra parameter to an event handler is common. There are two ways to do this in React:1.Using an inline arrow function, eg.:


RESETRUNFULL
<button onClick={(e) => this.deleteRow(id, e)}>Delete Row</button>

2. Binding the extra parameter, eg.:


RESETRUNFULL
<button onClick={this.deleteRow.bind(this, id)}>Delete Row</button>