- In HTML, the event name should be in lowercase:
<button onclick=’activateLasers()’>
Whereas in React 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 React you must call preventDefault() explicitly:
function handleClick(event) {
event.preventDefault()
console.log(‘The link was clicked.’)
}