Skip to content

Commit

Permalink
Clase platzi#6 - Eventos en React: onClick, onChange
Browse files Browse the repository at this point in the history
  • Loading branch information
scharcode committed Jan 4, 2024
1 parent 331845d commit 4fa226f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/CreateTodoButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ import './CreateTodoButton.css';

function CreateTodoButton() {
return (
<button className="CreateTodoButton">+</button>
<button
className="CreateTodoButton"
onClick={
(event) => {
console.log('Hiciste clic')
console.log(event)
console.log(event.target)
}
}
>+</button>
);
}

Expand Down
6 changes: 6 additions & 0 deletions src/TodoSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ function TodoSearch() {
<input
placeholder="Buscar TODO"
className="TodoSearch"
onChange={(event) => {
console.log('Escribiste en el TodoSearch')
console.log(event)
console.log(event.target)
console.log(event.target.value)
}}
/>
);
}
Expand Down

0 comments on commit 4fa226f

Please sign in to comment.