diff --git a/TODO-LIST/src/components/Todo.jsx b/TODO-LIST/src/components/Todo.jsx index a1bee9e..cbba2e2 100644 --- a/TODO-LIST/src/components/Todo.jsx +++ b/TODO-LIST/src/components/Todo.jsx @@ -1,14 +1,46 @@ -import React from 'react' +import React, { useState } from 'react' + + +const Todo = ({ todo, deleteTodo, moveUp, moveDown, total, index }) => { + + const [isEditing, setIsEditing] = useState(false); + const [editText, setEditText] = useState(todo.text); -const Todo = ({ todo,deleteTodo,moveUp,moveDown,total,index}) => { return (
{todo.text}
+ {isEditing ? ( + setEditText(e.target.value)} + /> +) : ( +{todo.text}
+)} +