Browse Source

modified handling-events page

main
sw-yx 7 years ago
parent
commit
037fdf82d0
  1. 10
      content/docs/handling-events.md

10
content/docs/handling-events.md

@ -145,11 +145,5 @@ The problem with this syntax is that a different callback is created each time t
Inside a loop it is common to want to pass a param to an event handler. For example if `i` is the row id:
```js
<button onClick={() => this.deleteRow(i)}>Delete Row</button>
```
or alternatively (especially if you want to avoid triggering a re-render in a child component):
```js
<button onClick={this.deleteRow.bind(this,i)}>Delete Row</button>
```
<button onClick={this.deleteRow.bind(this, i)}>Delete Row</button>
```
Loading…
Cancel
Save