Lección 5 de 10
Manejo de eventos
React maneja eventos de forma parecida a JavaScript normal, pero con nombres en camelCase y funciones en lugar de strings. Eventos comunes: onClick, onChange, onSubmit y onMouseEnter.
REACT
function Form() {
function handleClick() {
alert("Button clicked!");
}
function handleChange(event) {
console.log(event.target.value);
}
return (
<div>
<button onClick={handleClick}>Click me</button>
<input type="text" onChange={handleChange} />
</div>
);
}