title: why my redux state not updating
body: <p>state not updating.when action is dispatched the state should update to isAuthenticated to true..but the state not updating..redux returning the initial state not the updated state. </p>
  
  <pre><code>export function setCurrentUser(user) {
        console.log(user);
        return {
          type: "SET_CURRENT_USER",
          user
        };
      }
  
     ...
      export function login(userData) {
        return dispatch =&gt; {
          return axios.post('/user/auth',userData).then((res) =&gt; {
            const { status, sessionId, username, error} = res.data;
            if(status === "success"){
              dispatch(setCurrentUser(sessionId));
            }else {
              dispatch(invalidUser(error));
            }
          });
        }
      }
  
  //reducers
  
      import { SET_CURRENT_USER, INVALID_USER } from "../actions/types";
      import isEmpty from "lodash/isEmpty";
  
      const initialState = {
        isAuthenticated : false,
        user: {},
        error:{}
      };
  
      export default (state = initialState, action) =&gt; {
        switch(action.type){
          case SET_CURRENT_USER:
          return {
            ...state,
           isAuthenticated: !isEmpty(action.user),
           user:action.user
          }
          ...
          default: return state;
        }
      }
  </code></pre>
  
  <p>//component</p>
  
  <pre><code>onSubmit(e){
      e.preventDefault();
        this.setState({ errors: {}, isLoading:true });
        this.props.login(this.state).then(
        (res) =&gt; {
          console.log(this.props.userData);
          if(this.props.userData.isAuthenticated)
            this.context.router.push("greet");
          },
  </code></pre>
  
  <p>(err) => this.setState({ errors: err.response.data, isLoading: false })
          );</p>
  
  <pre><code>  }
  </code></pre>
  
  <p>.....</p>
  
  <pre><code>function mapStateToProps(state) {
    return {
      userData: state.authReducers
    };
  }
  
  export default connect(mapStateToProps, { login })(LoginForm);
  </code></pre>