質問編集履歴
2
修正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
× TypeError:
|
1
|
+
× TypeError: tasks.map is not a function
|
body
CHANGED
File without changes
|
1
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -89,14 +89,14 @@
|
|
89
89
|
}
|
90
90
|
},
|
91
91
|
deleteTask: (state,action) => {
|
92
|
-
state.tasks += state.
|
92
|
+
state.tasks += state.tasks.filter((t) =>t.id !== action.payload.id);
|
93
93
|
},
|
94
94
|
},
|
95
95
|
});
|
96
96
|
|
97
97
|
export const { newTask, completeTask, deleteTask } = taskSlice.actions;
|
98
98
|
|
99
|
-
export const selectTasks = (state) => state.task.
|
99
|
+
export const selectTasks = (state) => state.task.tasks;
|
100
100
|
|
101
101
|
export default taskSlice.reducer;
|
102
102
|
|