You get a bonus - 1 coin for daily activity. Now you have 1 coin

How do you pass a parameter to an event handler or callback in REACT?

Practice



You can use an arrow function to wrap around the event handler and pass parameters:

<button onClick={() => this.handleClick(id)} />
 
This is equivalent to calling .bind
:

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Scripting client side JavaScript, jqvery, BackBone"

Terms: Scripting client side JavaScript, jqvery, BackBone