title: How to define the mapDispatchToProps type of redux thunk function
body: <p>Follow the <a href="https://redux.js.org/recipes/usage-with-typescript#usage-with-redux-thunk" rel="nofollow noreferrer">official doc</a>, I make a login typescript like thunk function.</p>
  
  <pre><code>function loginApi(user: UserState) {
    return fetch(
      `${baseUrl}/login?user=${user.userName}&amp;pwd=${user.pwd}`
    )
      .then(res =&gt; res.json())
  }
  
  export const thunkLogin = (
    user: UserState
  ): ThunkAction&lt;void, AppState, null, Action&lt;string&gt;&gt; =&gt; async dispatch =&gt; {
    const asyncResp = await loginApi(user)
    dispatch(
      updateUser({
        loggedIn: asyncResp.isloggedIn,
        userName: user.userName,
        userPwd: user.userPwd
      })
    )
  }
  </code></pre>
  
  <p>I want add this thunk function to my app component using react-redux connect hoc function.</p>
  
  <pre><code>import { thunkLogin } from './thunkLoginPath'
  
  interface Props {
    // place 1
    thunkLogin: typeof thunkLogin
  }
  
  interface State {
    userName: string
    userPwd: string
  }
  
  class AppComponent extends React.Component&lt;Props, State&gt; {
    handleSubmit = () =&gt; {
      this.props.thunkLogin({
        userName: this.state.userName,
        userPwd: this.state.userPwd
      })
    }
  
    render(){
      return(
        &lt;TouchableOpacity
          style={style.loginBotton}
          onPress={this.handleSubmit}
        &gt;
          &lt;Text style={style.loginBottomText}&gt;LOGIN&lt;/Text&gt;
        &lt;/TouchableOpacity&gt;
      )
    }
  }
  
  export default connect(
    (state: AppState) =&gt; ({
      user: state.user
    }),
    // place 2
    { thunkLogin }
  )(AppComponent)
  </code></pre>
  
  <p>It report a error show that the thunkLogin declare at Props not assignable to mapDispatchToProps (place 1 -> place 2).</p>