Answers for "get syntethicbaseevent and parameter in react"

0

handling event in jsx

//Event hadling in react
function ActionLink() {
  function handleClick(e) {
    e.preventDefault();
    console.log('The link was clicked.');
  }

  return (
    <a href="#" onClick={handleClick}>
      Click me
    </a>
  );
}
Posted by: Guest on May-01-2020
1

get syntethicbaseevent and parameter in react

Try this:

<button onClick={(e) => clickMe(e, someParameter)}>Click Me!</button>

And in your function:

function clickMe(event, someParameter){
     //do with event
}
Posted by: Guest on November-15-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language