title: useReducer incrementing / decrementing 2 instead of 1
body: <p>I'm just trying to learn the useReducer hook in react. Just playing around. Can someone help with an issue I'm having? When I click the button to &quot;plus a unit&quot; or &quot;minus&quot; a unit it takes 2 away. Any suggestions?</p>
  <p>Perhaps map. is a bad method for updating the state in the reducer?</p>
  <p>Test code below. I've put it all into one component for purpose of below, rather than posting all the context stuff and children.</p>
  <p>Any help much appreciated :)</p>
  <pre><code>import React, {useReducer} from 'react'
  
  function Test() {
  
      const itemFile = [
          {sku: '123456', description: 'item 1', stockavailable: 5},
          {sku: '654321', description: 'item 2', stockavailable: 1},
          {sku: '666666', description: 'item 3', stockavailable: 0},
      
        ]
  
      const reducer = (state,action) =&gt; {
          switch (action.type) {
              case 'DELETE_LINE':
                  let newstate = state.filter(item =&gt; item.sku !== action.payload)
                  return newstate
              case 'MINUS_ONE_UNIT':
                  return state.map(item =&gt; {
                      if(item.sku === action.payload) {
                          item.stockavailable = item.stockavailable-1;
                      }
                      return item;
                    })
              case 'PLUS_ONE_UNIT':
              return state.map(item =&gt; {
                  if(item.sku === action.payload) {
                      item.stockavailable = item.stockavailable+1;
                  }
                  return item;
                  })
              default:
                  return state
          }
  
      }
  
      const [liveItemFile, dispatch] = useReducer(reducer, itemFile);
  
    return (    
      &lt;&gt;
          {liveItemFile.map((item) =&gt; (
              &lt;div key={item.sku}&gt;
                  {item.sku}: {item.description} - {item.stockavailable}
                  &lt;button onClick={() =&gt; dispatch({type: 'DELETE_LINE', payload: item.sku})}&gt;
                      DELETE LINE
                  &lt;/button&gt;
  
                  &lt;button onClick={() =&gt; dispatch({type: 'MINUS_ONE_UNIT', payload: item.sku})}&gt;
                      Minus Unit
                  &lt;/button&gt;
                  &lt;button onClick={() =&gt; dispatch({type: 'PLUS_ONE_UNIT', payload: item.sku})}&gt;
                      Plus Unit
                  &lt;/button&gt;
              &lt;/div&gt;
          ))}
      &lt;/&gt;
    );
  }
  
  export default Test;
  </code></pre>