Using The Event Handler Function in React: Showing Alert
To Show the alert, we will use a button as in html and handle the click event as in javaScript.
import "./App.css";
export default function App() {
const showAlert=()=>{
alert('You have clicked button');
}
return (
<div className="App"...
swapnilg671.hashnode.dev1 min read