title: updating state in reducer not updating component
body: <p>I was trying to update my state from an api, using <a href="https://redux.js.org/docs/recipes/reducers/ImmutableUpdatePatterns.html#updating-an-item-in-an-array" rel="nofollow noreferrer">this approach</a>. So I created the following code in my reducer:</p>
  
  <pre><code>export default function(state = null, action){
      switch(action.type){
          case ROUTING_BOOKS:
              return action.payload.data;
          case UPDATE_BOOK:
              let newVals = state.map((item)=&gt;{
                  if(item.MatItemKey === action.meta.book.MatItemKey){
                      return update(item, {$merge: action.payload.data})
  
                  }else{
                      return item
                  }
              });
              console.log(newVals);
              return newVals
      }
      return state
  }
  </code></pre>
  
  <p>newVals returns back the values I want in my state. However, the component that is using this reducer using connect:</p>
  
  <pre><code>function mapStateToProps(state){
      return{
          routing: state.activeRouting,
          routingBooks: state.routingBooks
      };
  }
  
  export default connect(mapStateToProps, mapDispatchToProps)(RoutingTable);
  </code></pre>
  
  <p>ROUTING_BOOKS updates the component, but my calls to UPDATE_BOOK appear to update the reducer, but not the RoutingTable component. </p>
  
  <p>EDIT: Sample data from UPDATE_BOOK</p>
  
  <blockquote>
    <p>[{"RoutingStepKey":4752755,"MaterReqPer":1,"MatItemKey":216158,"MatReqPc":1,"StepID":"000010","OperationType":"M","OperationDesc1":"Default Material Step","LongDesc":"Who Am I?"},{"RoutingStepKey":4752756,"MaterReqPer":1,"MatItemKey":216056,"MatReqPc":1,"StepID":"000020","OperationType":"M","OperationDesc1":"Default Material Step","LongDesc":"Mammals Love Their Babies"},{"RoutingStepKey":4752758,"MaterReqPer":1,"MatItemKey":218213,"MatReqPc":1,"StepID":"000030","OperationType":"M","OperationDesc1":"Default Material Step","LongDesc":"My Forest"}]</p>
  </blockquote>
  
  <p>Sample data from Update_Book:</p>
  
  <blockquote>
    <p>[{"RoutingStepKey":4752755,"MaterReqPer":1,"MatItemKey":216158,"MatReqPc":1,"StepID":"000010","OperationType":"M","OperationDesc1":"Default Material Step","LongDesc":"Who Am I?"...more data added},{"RoutingStepKey":4752756,"MaterReqPer":1,"MatItemKey":216056,"MatReqPc":1,"StepID":"000020","OperationType":"M","OperationDesc1":"Default Material Step","LongDesc":"Mammals Love Their Babies"...more data added},{"RoutingStepKey":4752758,"MaterReqPer":1,"MatItemKey":218213,"MatReqPc":1,"StepID":"000030","OperationType":"M","OperationDesc1":"Default Material Step","LongDesc":"My Forest"...more data added}]</p>
  </blockquote>
  
  <p>Combine Reducers:</p>
  
  <pre><code>import {combineReducers} from 'redux';
  import books from './books';
  import routings from './routings';
  import activeBook from './activeBook';
  import activeRouting from './activeRouting';
  import options from './options';
  import login from './login';
  import uiState from './uiState';
  import routingBooks from './routingBooks';
  
  const rootReducer = combineReducers({
      books,
      routingBooks,
      activeBook,
      activeRouting,
      options,
      routings,
      login,
      uiState
  });
  
  export default rootReducer;
  </code></pre>