title: React-TypeScript - Property 'then' does not exist on type '(dispatch: Dispatch<AnyAction>) => Promise<void>'
body: <p>I'm using redux-toolkit for redux state management. Here is the code showing error</p>
  <pre><code>import * as actions from &quot;../../../_redux/entities/entitiesActions&quot;;
  import { useDispatch } from &quot;react-redux&quot;;
  import { strict } from &quot;assert&quot;;
  
  
  const dispatch = useDispatch();
  
  const deleteEntity = () =&gt; {
      // server request for deleting device by id
      dispatch(actions.deleteEntity(id)).then(() =&gt; {    //Error on this line
        // refresh list after deletion
        dispatch(actions.fetchEntities(entitiesUIProps.queryParams));
      });
    };
  </code></pre>
  <p>And entitiesActions.ts is here</p>
  <pre><code>//EntitiesActions.ts
  const {actions} = entitesSlice;
  
  export const fetchEntites = (queryParams:any) =&gt; (dispatch:Dispatch) =&gt; {
    dispatch(actions.startCall({ callType: callTypes.list }));
    return requestFromServer
      .findEntites(queryParams)
      .then(response =&gt; {
        const { totalCount, entities } = response.data;
        dispatch(actions.entitesFetched({ totalCount, entities }));
      })
      .catch(error =&gt; {
        error.clientMessage = &quot;Can't find entites&quot;;
        dispatch(actions.catchError({ error, callType: callTypes.list }));
      });
  };
  
  export const deleteEntity = (id:string) =&gt; (dispatch:Dispatch) =&gt; {
      dispatch(actions.startCall({ callType: callTypes.action }));
      return requestFromServer
        .deleteEntity(id)
        .then(response =&gt; {
          dispatch(actions.deviceDeleted({ id }));
        })
        .catch(error =&gt; {
          error.clientMessage = &quot;Can't delete device&quot;;
          dispatch(actions.catchError({ error, callType: callTypes.action }));
        });
    };
  
  </code></pre>
  <p>I don't know how to resolve this error. Please help!
  Thanks!</p>
  <p><strong>Edit:</strong></p>
  <p>If I removed <code>then</code> block from outer dispatch, the error goes away but I'm afraid this will cause the nested dispatch to fire before outer dispatch execution finishes?</p>
  <pre><code>const deleteEntity = () =&gt; {
      // server request for deleting device by id
      dispatch(actions.deleteEntity(id));//.then(() =&gt; {    //Error goes away
        // refresh list after deletion
        dispatch(actions.fetchEntities(entitiesUIProps.queryParams));
      //});
    };
  </code></pre>