title: Why Immer didn't return me a new state even if I modified the draft?
body: <p>I don't know why even I have modified the draft, immer didn't provide me with a new state, but the old state instance with modified content.</p>
  <pre><code>import CartItem from &quot;../../models/cart-item&quot;;
  import * as actions from &quot;../actions/actionTypes&quot;;
  import produce from &quot;immer&quot;
  
  
  const initialState = [];
  
  const reducer = (state=initialState, action) =&gt; {
      switch (action.type) {
          case actions.ADD_TO_CART:
            const {id, title, price} = action.product;
            const itemIndexInCart = state.findIndex(item =&gt; item.id === id);
  
            const nextState = produce(state, draftState =&gt; {
              if (itemIndexInCart === -1) {
                draftState.push(new CartItem(id, 1, price, title, price));
              } else {
                draftState[itemIndexInCart]['quantity']++;
                draftState[itemIndexInCart]['sum'] += price;
              }
            });
            console.log(state === nextState);
            return nextState;
          default:
              return state;
      }
  };
  
  export default reducer;
  </code></pre>
  <p>It is working when new item is pushing into the array, but it is not working as expected when I want to modify the quantity and sum of the array item. The log show me it's the same object under that circumstances.</p>