title: Redux + Typescript + typesafe-actions:
body: <p>Having an issue using Typescript 3.2.2 with typesafe-actions 3.0.0. I have created an example below showing the issue.</p>
  
  <p>Basically in my reducer, <code>payload</code> is not defined on <code>action</code> because some of my actions are of type <code>EmptyAction</code>, which does not define a <code>payload</code> property. If I change these to have an empty payload (<code>{}</code>), then <code>payload</code> is defined for all actions, but now the type of <code>payload</code> is not being determined based on the <code>type</code> of the action (in the reducer).</p>
  
  <p>I believe I've followed the <a href="https://github.com/piotrwitek/typesafe-actions#behold-the-mighty-tutorial" rel="nofollow noreferrer">Mighty Tutorial</a> correctly.</p>
  
  <p>Working example: <a href="https://github.com/JoshMcCullough/react-ts-test" rel="nofollow noreferrer">https://github.com/JoshMcCullough/react-ts-test</a></p>
  
  <p><strong>action-types.ts</strong></p>
  
  <pre><code>export default {
      GET_PROFILES_REQUEST: "GET_PROFILES_REQUEST",
      GET_PROFILES_SUCCESS: "GET_PROFILES_SUCCESS",
      GET_PROFILES_FAILURE: "GET_PROFILES_FAILURE",
  };
  </code></pre>
  
  <p><strong>actions.ts</strong></p>
  
  <pre><code>import { action } from "typesafe-actions";
  import { ApiErrorResponse } from "../../app/api/ApiErrorResponse";
  import { Profile } from "../../app/models/Profile";
  import ActionTypes from './action-types';
  
  export const getProfilesRequest = () =&gt; action(ActionTypes.GET_PROFILES_REQUEST); // EmptyAction&lt;string&gt;
  export const getProfilesSuccess = (profiles: Profile[]) =&gt; action(ActionTypes.GET_PROFILES_SUCCESS, { profiles }); // Action&lt;string, { profiles: Profile[] }&gt;
  export const getProfilesFailure = (error: ApiErrorResponse) =&gt; action(ActionTypes.GET_PROFILES_FAILURE, { error }); // Action&lt;string, { error: ApiErrorResponse }&gt;
  </code></pre>
  
  <p><strong>reducer.ts</strong></p>
  
  <pre><code>import { ActionType, getType } from "typesafe-actions";
  import * as Actions from './actions';
  import { Profile } from "../../app/models/Profile";
  
  // reducer
  export type ProfileAction = ActionType&lt;typeof Actions&gt;;
  
  export type State = {
      profiles: Profile[];
      errorMessage: string;
      loading: boolean;
  };
  
  const INITIAL_STATE = {
      profiles: [],
      errorMessage: null,
      loading: false,
  };
  
  export default (state: State = INITIAL_STATE, action: ProfileAction): State =&gt; {
      switch (action.type) {
          case getType(Actions.getProfilesRequest): return {
              ...state,
              loading: true,
          };
  
          case getType(Actions.getProfilesSuccess): return {
              ...state,
              profiles: action.payload.profiles,
              // ERROR: Property 'payload' does not exist on type 'EmptyAction&lt;string&gt; | PayloadAction&lt;string, { profiles: Profile[]; }&gt; | PayloadAction&lt;string, { error: ApiErrorResponse; }&gt;'.
              // Property 'payload' does not exist on type 'EmptyAction&lt;string&gt;'. [2339]
              loading: false,
          };
  
          case getType(Actions.getProfilesRequest): return {
              ...state,
              errorMessage: action.payload.error.message,
              // ERROR: Property 'payload' does not exist on type 'EmptyAction&lt;string&gt; | PayloadAction&lt;string, { profiles: Profile[]; }&gt; | PayloadAction&lt;string, { error: ApiErrorResponse; }&gt;'.
              // Property 'payload' does not exist on type 'EmptyAction&lt;string&gt;'. [2339]
              loading: false,
          };
  
          default: return state;
      }
  };
  </code></pre>