title: reducer does not update state in react redux
body: <p>I am trying update state using react-redux but the state is not being updated.
  new value is coming to 
  "if (action.type === 'SET_LOGGED_IN')" 
  in reducer, but not updating the isLoggedIn as true. 
  What was wrong?
  <a href="https://codesandbox.io/s/148rm8qy9q" rel="nofollow noreferrer">find the code</a></p>
  
  <p><strong>Login.js</strong></p>
  
  <pre><code>function handleLoginClick(username, password, e) {
      e.preventDefault();
  
      post('/createUser', { username, password })
          .then(({ status }) =&gt; {
              if (status === 200) {
                  console.log(this.props);
                  this.props.setLoggedIn(true);
                  this.props.history.push('/');
              }else{
                  this.props.setLoggedIn(false);
  
              }
          })
          .catch(error =&gt; {
          .........
          })
  }
  ..................
  const mapStateToProps = state =&gt; {
      return {isLoggedIn : state.reducer.isLoggedIn};};
  const mapDispatchToProps = dispatch =&gt; {
      return {setLoggedIn : (value) =&gt; dispatch({type: 'SET_LOGGED_IN', value: value}),}};
  
  export default compose(
      withStyles(styles),
      withRouter,
      connect(mapStateToProps, mapDispatchToProps)
  )(NewLogin);
  </code></pre>
  
  <p><strong>reducer.js</strong></p>
  
  <pre><code>import { combineReducers } from 'redux';
  import { reducer as reduxFormReducer } from 'redux-form';
  
  const initialStates = {
      isLoggedIn : false
  };
  
  const reducers = combineReducers({
      reducer : (state = initialStates, action) =&gt; {
          //console.log(action);
          if (action.type === 'SET_LOGGED_IN') {
              //console.log(action);
              return {
                  ...state,
                  isLoggedIn: action.value
              };
          }
          return state;
      },
  
          form: reduxFormReducer, // mounted under "form"
  });
  
  export default reducers;
  </code></pre>