Skip to content

Commit 63299f5

Browse files
committed
Cambios de la clase 8
1 parent 5ef1fff commit 63299f5

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/components/TodoItem.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from "react"
2+
3+
const TodoItem = ({ todo }) => {
4+
return <li>{todo.text}</li>
5+
}
6+
7+
export default TodoItem

src/components/TodoList.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useState, useEffect } from "react"
2+
import TodoItem from "./TodoItem"
23

34
const TodoList = () => {
45
const [todos, setTodos] = useState([])
@@ -63,7 +64,7 @@ const TodoList = () => {
6364

6465
<ul>
6566
{todos.map((todo, index) => (
66-
<li key={index}>{todo.text}</li>
67+
<TodoItem key={index} todo={todo} />
6768
))}
6869
</ul>
6970
</div>

0 commit comments

Comments
 (0)