Handling Events: Passing Arguments to Event Handlers

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

In both cases of demo code, the 'e' argument representing the React event will be passed as a second argument after the ID. With an arrow function, we have to pass it explicitly, but with bind any further arguments are automatically forwarded.

Related concepts

Passing Arguments to Event Handlers

Handling Events: Passing Arguments to Event Handlers — Structure map

Clickable & Draggable!

Handling Events: Passing Arguments to Event Handlers — Related pages: