Skip to content

Commit 183bf52

Browse files
committed
Update event parameter question
1 parent 67d023f commit 183bf52

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,13 @@
603603
```jsx harmony
604604
<button onClick={this.handleClick.bind(this, id)} />
605605
```
606+
Apart from these two approaches, you can also pass arguments to a function which is defined as array function
607+
```jsx harmony
608+
<button onClick={this.handleClick(id)} />
609+
handleClick = (id) => () => {
610+
console.log("Hello, your ticket number is", id)
611+
};
612+
```
606613
607614
16. ### What are synthetic events in React?
608615

0 commit comments

Comments
 (0)