How do you pass an event handler to a component?
You can pass event handlers and other functions as props to child components. It can be used in child component as below:
1 | <button onClick={this.handleClick}> |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.