Skip to content

Commit 5f4bf12

Browse files
committed
Delete tasks event handler function added/completed
1 parent 70adeeb commit 5f4bf12

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/ToDo.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ const ToDo = ({ text, todos, setTodos, todo}: any) => {
55

66
const ToDoDeleteHandler = function(): void {
77

8-
setTodos(todos.filter((t: any) => t.text !== text));
9-
8+
// setTodos(todos.filter((t: any) => t.text !== text));
9+
setTodos(todos.filter((t: any) => t.id !== todo.id));
10+
1011
}
1112

1213
return (

0 commit comments

Comments
 (0)