how to have a onClick event and pass parameters within function in react js code example
Example: how to call a function in react with arguments onclick
<button onClick={() => sayHello('James')}>Greet</button>
<button onClick={() => sayHello('James')}>Greet</button>