title: How to change property in Redux Toolkit
body: <p>I need to select <code>productItem</code> from the Redux state and change the property. When I click the <code>Mark All</code> button I want to be selected all items in <code>li</code>.</p>
  <p><strong>productSlice.js</strong></p>
  <pre><code>    const productSlice = createSlice({
    name: &quot;product&quot;,
    initialState: [],
    reducers: {
      addProduct: (state, action) =&gt; {
        const productItem = {
          id: nanoid(),
          title: action.payload.title,
          isComplete: false,
        };
        state.push(productItem);
      },
      toggleComplete: (state, action) =&gt; {
        const idx = state.findIndex(
          (product) =&gt; product.id === action.payload.id
        );
        state[idx].isComplete = action.payload.isComplete;
      },
    },
  });
  
  export const { addProduct, toggleComplete } = productSlice.actions;
  
  export default productSlice.reducer;
  </code></pre>
  <p><strong>ProductList.js</strong></p>
  <pre><code>import React from &quot;react&quot;;
  import { useSelector } from &quot;react-redux&quot;;
  import ProductItem from &quot;./ProductItem&quot;;
  import { Form } from &quot;react-bootstrap&quot;;
  import { useDispatch } from &quot;react-redux&quot;;
  
  import &quot;./ProductList.css&quot;;
  import { toggleComplete } from &quot;../redux/productSlice&quot;;
  
  function ProductList({ id, isComplete }) {
    const productItem = useSelector((state) =&gt; state.product);
    const dispatch = useDispatch();
  
    function handleMarkAll() {
      dispatch(
        toggleComplete({
          id: id,
          isComplete: !isComplete,
        })
      );
    }
  
    return (
      &lt;ul className=&quot;productUl&quot;&gt;
        &lt;Form.Check label=&quot;Mark All&quot; onChange={handleMarkAll} /&gt;
  
        {productItem.map((product, idx) =&gt; (
          &lt;ProductItem
            key={idx}
            id={product.id}
            title={product.title}
            isComplete={product.isComplete}
          /&gt;
        ))}
      &lt;/ul&gt;
    );
  }
  
  export default ProductList;
  </code></pre>
  <p>When <code>Mark All</code> button is clicked, want to change <code>productItem.isComplete</code> to <code>!isComplete</code></p>