how to pass other parameter with event parameter in a function react code example
Example 1: how to pass a value to a react funtion without immediately firing it
<button onClick={(e) => {
this.clickMe(e, someParameter)
}}>Click Me!</button>
Example 2: passing argument to function handler functional compoent javascript react
function MyComponent(props) {
function handleChange(event, data){
console.log(event.target.value);
console.log(data)
}
return <button onClick={(event) => handleChange(event, 'Some Custom Value')} value='Foo'>Click</button>
}