From 8ea9d52957c5661259b89d8bc91d4561aaee41ec Mon Sep 17 00:00:00 2001 From: muyangren918 <65386952+muyangren918@users.noreply.github.com> Date: Fri, 19 Jul 2024 00:08:35 +0800 Subject: [PATCH] Update why-rtk-is-redux-today.md (#4719) --- docs/introduction/why-rtk-is-redux-today.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/introduction/why-rtk-is-redux-today.md b/docs/introduction/why-rtk-is-redux-today.md index 5f570840ae..3bb56246d3 100644 --- a/docs/introduction/why-rtk-is-redux-today.md +++ b/docs/introduction/why-rtk-is-redux-today.md @@ -79,7 +79,7 @@ export const addTodo = text => ({ export const todoToggled = id => ({ type: TODO_TOGGLED, - payload: { id } + payload: id }) export const todosReducer = (state = [], action) => { @@ -92,7 +92,7 @@ export const todosReducer = (state = [], action) => { }) case TODO_TOGGLED: return state.map(todo => { - if (todo.id !== action.payload.id) return todo + if (todo.id !== action.payload) return todo return { ...todo,