title: React-redux: Update value in array
body: <p>As an initial state I use array of objects:</p>
  <pre><code>   export default{
        items: [
            {
              Date: 1,
              Operation: 'revenue',
            }
         ]
     }
  </code></pre>
  <p>In component I dispatch the action, which must update one element in object of array: &quot;Operation&quot;</p>
  <pre><code> const mapDispatchToProps = (dispatch) =&gt; {
          return {
              selectOperation: (input) =&gt; dispatch({type: app.SELECT, payload: input})
           }
    };
  
     class OperationSelect extends React.Component {
        // constructor
  
        handleChange(event) {
           this.props.selectOperation({
              key: 'Operation',
              value: event.target.value
            });
        };
  
       // render() logic 
    }
  
   export default connect(null, mapDispatchToProps)(OperationSelect)
  </code></pre>
  <p>Reducer:</p>
  <pre><code> import initialState from '../constants/initialState';
   import { app } from '../constants/types';
  
   export default function update(state = initialState,  action) {
      switch (action.type) {
          case app.SELECT:
              return {
                  ...state,
                  [action.payload.key]: state.items.map(
                      (item, i)=&gt; i===0 ? {...item, Operation: action.payload.value}
                      : item
                  )
                };
          default:
              return state;
         }
     }
  </code></pre>
  <p>But, when I select new value and application run handleChange, dispatch the action, run reducer, the state in store keeps the old value of &quot;Operation&quot;.</p>
  <p>What am I doing wrong?</p>