Answers for "passing argument to function handler functional compoent javascript react"

0

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>
}
Posted by: Guest on September-23-2020

Code answers related to "passing argument to function handler functional compoent javascript react"

Code answers related to "Javascript"

Browse Popular Code Answers by Language