title: type error with redux-thunk when using connect
body: <p>I am using redux and redux-thunk with typescript. I am trying to inject to a component through connect() a simple thunk action creator, using mapDispatchToProps. </p>
  
  <p><strong>Actions</strong></p>
  
  <pre><code>export enum TestActionTypes {
    THUNK_ACTION = "THUNK_ACTION"
  }
  
  export interface ThunkAction {
    type: TestActionTypes.THUNK_ACTION;
  }
  
  export type TestAction = ThunkAction;
  </code></pre>
  
  <p><strong>Action Creators</strong></p>
  
  <pre><code>export function thunkActionCreator() {
    return function(dispatch: Dispatch&lt;any&gt;) {
      dispatch({ type: TestAction.THUNK_ACTION });
    };
  </code></pre>
  
  <p><strong>Connected Component</strong></p>
  
  <pre><code>interface DemoScreenState {}
  
  interface OwnProps {}
  
  interface StateProps {}
  
  interface DispatchProps {
    testThunk: () =&gt; void;
  }
  
  type DemoScreenProps = StateProps &amp; DispatchProps &amp; OwnProps;
  
  class DemoScreen extends React.Component&lt;
    DemoScreenProps,
    DemoScreenState
  &gt; {
    constructor(props: DemoScreenProps) {
      super(props);
    }
  
    componentDidMount() {
      this.props.testThunk();
    }
  
    render() {
      return null;
    }
  }
  
  function mapStateToProps(state: any): StateProps {
    return {};
  }
  
  function mapDispatchToProps(dispatch: Dispatch&lt;any&gt;): DispatchProps {
    return {
      testThunk: () =&gt; dispatch(thunkActionCreator())
    };
  }
  
  export default connect&lt;StateProps, DispatchProps, OwnProps&gt;(
    mapStateToProps,
    mapDispatchToProps
  )(DemoScreen);
  </code></pre>
  
  <p><strong>Store</strong></p>
  
  <pre><code> import { createStore, applyMiddleware } from "redux";
   import rootReducer from "./RootReducer";
   import thunk from "redux-thunk";
  
   const store = createStore(rootReducer, applyMiddleware(thunk));
  
   export default store;
  </code></pre>
  
  <p>However, I am encountering two issue when using connect(). First of all, I get a type error for the declaration of testThunk in mapDispatchToProps.</p>
  
  <p><em>Argument of type '(dispatch: Dispatch) => void' is not assignable to parameter of type 'Action'. Property 'type' is missing in type '(dispatch: Dispatch) => void'.</em> I don't know how to handle this, as by definition a thunk is different from a plain action. </p>
  
  <p><strong>* EDIT 24/10/2018 *</strong> cf answer below, using:</p>
  
  <pre><code>"@types/react-redux": "^6.0.9",
  "react": "16.3.1",
  "react-native": "~0.55.2",
  "react-redux": "^5.0.7",
  "redux": "^4.0.1",
  "redux-thunk": "^2.3.0"
  </code></pre>