Below are the few differences between HTML and React event handling, 1. In HTML, the event name should be in lowercase.
<button onclick="activateLasers()">
Whereas in ReactJS it follows camelCase convention,
<button onClick={activateLasers}>
- In HTML, you can return false to prevent default behavior,
<a href="#" onclick="console.log('The link was clicked.'); return false"/>
- Whereas in ReactJS you must call preventDefault explicitly,
function handleClick(e) {
e.preventDefault();
console.log('The link was clicked.');
}