Skip to content

Commit 4fa226f

Browse files
committed
Clase platzi#6 - Eventos en React: onClick, onChange
1 parent 331845d commit 4fa226f

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/CreateTodoButton.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@ import './CreateTodoButton.css';
22

33
function CreateTodoButton() {
44
return (
5-
<button className="CreateTodoButton">+</button>
5+
<button
6+
className="CreateTodoButton"
7+
onClick={
8+
(event) => {
9+
console.log('Hiciste clic')
10+
console.log(event)
11+
console.log(event.target)
12+
}
13+
}
14+
>+</button>
615
);
716
}
817

src/TodoSearch.js

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ function TodoSearch() {
55
<input
66
placeholder="Buscar TODO"
77
className="TodoSearch"
8+
onChange={(event) => {
9+
console.log('Escribiste en el TodoSearch')
10+
console.log(event)
11+
console.log(event.target)
12+
console.log(event.target.value)
13+
}}
814
/>
915
);
1016
}

0 commit comments

Comments
 (0)