title: Why redux toolkit boolean toggle doesn't work?
body: <p>I keep a boolean value called &quot;isCompleted&quot;, but it doesn't work. It becomes true when false, but does not become false again afterwards. The Redux action and the function I wrote are as follows. What could be the reason for this? Thanks for advance.</p>
  <pre><code>const todoSlice = createSlice({
      name: 'todos',
      initialState: {
          todos: []
      },
      reducers: {
          addTodo: (state, action) =&gt; {
              state.todos = [...state.todos, action.payload]
          },
          deleteTodo: (state, action) =&gt; {
              state.todos = action.payload
          },
          completedTodo: (state, action) =&gt; {
              state.todos = action.payload
          }
      }
  })
  
  export const {
      addTodo,
      deleteTodo,
      completedTodo
  } = todoSlice.actions
  
  export const selectUser = (state) =&gt; state.todos;
  
  export const store = configureStore({
      reducer: todoSlice.reducer
  })
  </code></pre>
  <pre><code>const Todo = () =&gt; {
      const user = useSelector(selectUser);
      const dispatch = useDispatch();
  
      const checkHandler = (id) =&gt; {
          const dene = user.map((item) =&gt; {
              if (item.id === id) {
                  const comp = item.isCompleted
                  return {
                      ...item,
                      isCompleted: !item.isCompleted
                  };
              }
          })
          dispatch(completedTodo({dene}))
      }
  
      const deleteHandler = (id) =&gt; {
          const filteredTodos = user.filter(todo =&gt; todo.id !== id)
          dispatch(deleteTodo(filteredTodos))
      }
  
      return (
          user.map((todo) =&gt; {
              return &lt;li key={todo.id} className={todo.isChechked ? &quot;todo-item checked&quot; : &quot;todo-item&quot;}&gt;
                  &lt;p&gt;{todo.title}&lt;/p&gt;
                  &lt;div className=&quot;btns&quot;&gt;
                      &lt;IconButton onClick={() =&gt; deleteHandler(todo.id)} className=&quot;trash-btn&quot; aria-label=&quot;delete&quot;&gt;
                          &lt;DeleteIcon /&gt;
                      &lt;/IconButton&gt;
                      &lt;IconButton onClick={() =&gt; checkHandler(todo.id)} className=&quot;complete-btn&quot; aria-label=&quot;delete&quot;&gt;
                          &lt;CheckIcon /&gt;
                      &lt;/IconButton&gt;
                  &lt;/div&gt;
              &lt;/li&gt;
          })
      )
  }
  
  export default Todo
  </code></pre>
  <p>What is the best boolean toggle method for Redux?</p>