Answers for "react click the button and get the data and pass a param"

0

pass parameter to handleclick react

import React from 'react';

const ExampleComponent = () => {
  
  function sayHello(name) {
    alert(`hello, ${name}`);
  }
  
  return (
    <button onClick={() => sayHello('James')}>Greet</button>
  );
Posted by: Guest on September-19-2021

Code answers related to "react click the button and get the data and pass a param"

Code answers related to "Javascript"

Browse Popular Code Answers by Language