title: Returning promise object on GET API request by Redux and Axios
body: <p>I am trying to fetch data by sending get request to api, I am getting data but Its in the promise object,</p>
  
  <p>I have tried in couple of techniques to resolve this issue, but I am unable to solve the problem.</p>
  
  <p><strong>Reducer: personal-detail-reducer.js</strong></p>
  
  <pre><code>import Http from "../utils/Http";
  import {PERSONAL_DETAIL} from "../constants/api";
  import {GET_PERSONAL_DETAIL} from "../constants/personsal-detail-constants";
  
  const initialState = {
      data: ''
  };
  
  const personalDetailReducer = (state = initialState, action) =&gt; {
      if(action.type === GET_PERSONAL_DETAIL){
          return (dispatch) =&gt; {
              return Http.get(PERSONAL_DETAIL).then(response =&gt; {
                  return{
                      data: dispatch(response.data.data)
                  };
              }).catch(error =&gt; {});
          }
      }
      return state;
  };
  
  export default personalDetailReducer;
  </code></pre>
  
  <p><strong>Component: personal-detail.js</strong></p>
  
  <pre><code>const mapStateToProps = (state) =&gt; {
      return{
          state
      }
  };
  const mapDispatchToProps = (dispatch) =&gt; {
      return {
          onGetPersonalDetail: () =&gt; dispatch({type: GET_PERSONAL_DETAIL})
      }
  }
  export default connect(mapStateToProps, mapDispatchToProps) (TutorPersonalDetail);
  </code></pre>
  
  <p>I have already configured thunk</p>
  
  <p><strong>store.js</strong></p>
  
  <pre><code>import {createStore, applyMiddleware} from 'redux';
  import thunkMiddleware from 'redux-thunk';
  import {createLogger} from 'redux-logger';
  import {rootReducer} from '../reducers/index';
  
  const loggerMiddleware = createLogger();
  
  export const store = createStore(
      rootReducer,
      applyMiddleware(
          thunkMiddleware,
          loggerMiddleware
      )
  );
  </code></pre>
  
  <p>Please find the attachment for reference <a href="https://i.stack.imgur.com/L8sno.png" rel="nofollow noreferrer">Here is the dispatch response in next state and console as well which is returning dispatch</a></p>