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>

Author of content
Edit this page

Made by Michael Sakhniuk

Twitter