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,

<button onClick="{this.handleClick}"></button>

Made in India with ❤️ by Rajesh Kumar Yadav

Twitter