How to dispatch an Action or a ThunkAction (in TypeScript, with redux-thunk)? : <p>Say I have code like so:</p>

<pre><code>import { Action, Dispatch } from 'redux';
import { ThunkAction } from 'redux-thunk';

interface StateTree {
  field: string;
}

function myFunc(action: Action | ThunkAction&lt;void, StateTree, void&gt;,
                dispatch: Dispatch&lt;StateTree&gt;) {
  dispatch(action); // &lt;-- This is where the error comes from
}
</code></pre>

<p>...I get this error from the TypeScript compiler:</p>

<pre><code>ERROR in myFile.ts:x:y
TS2345: Argument of type 'Action | ThunkAction&lt;void, StateTree, void&gt;' is not assignable to parameter of type 'Action'.
  Type 'ThunkAction&lt;void, StateTree, void&gt;' is not assignable to type 'Action'.
  Property 'type' is missing in type 'ThunkAction&lt;void, StateTree, void&gt;'.
</code></pre>

<p>I believe the problem is because of the way the <code>redux-thunk</code> type definition file augments the <code>redux</code> <code>Dispatch</code> interface and the inability for TypeScript to know which definition of <code>Dispatch</code> to use.</p>

<p>Is there a way around this?</p>
