react how to make a button.jsx code example
Example 1: react button onclick
import React from 'react';
function App() {
function sayHello() {
alert('Hello!');
}
return (
);
}
export default App;
Example 2: react event listener
onClick onContextMenu onDoubleClick onDrag onDragEnd onDragEnter onDragExit
onDragLeave onDragOver onDragStart onDrop onMouseDown onMouseEnter onMouseLeave
onMouseMove onMouseOut onMouseOver onMouseUp