Event handling in React is similar to handling events in regular HTML, but with some differences.
React events are camelCased, and you pass functions as event handlers rather than strings.
React uses synthetic events that wrap the native browser events, providing a consistent API across different browsers and better performance.
function Button() { const handleClick = (event) => { console.log('Button clicked!'); event.preventDefault(); // Prevent default behavior };
return ( <button onClick={handleClick}> Click me </button> ); }