We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ef1fff commit 63299f5Copy full SHA for 63299f5
src/components/TodoItem.jsx
@@ -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
@@ -1,4 +1,5 @@
import { useState, useEffect } from "react"
+import TodoItem from "./TodoItem"
const TodoList = () => {
const [todos, setTodos] = useState([])
@@ -63,7 +64,7 @@ const TodoList = () => {
63
64
65
<ul>
66
{todos.map((todo, index) => (
- <li key={index}>{todo.text}</li>
67
+ <TodoItem key={index} todo={todo} />
68
))}
69
</ul>
70
</div>
0 commit comments