pasing value to button in react code example Example: how to call a function in react with arguments onclick <button onClick={() => sayHello('James')}>Greet</button>