0 votes
in ReactJS by
How do you pass an event handler to a component in ReactJS, explain with example?

1 Answer

0 votes
by

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>
...