title: Argument of type '(dispatch: Dispatch) => void' is not assignable to parameter of type 'AnyAction'
body: <p>The error itself:</p>
  <pre><code>(alias) deleteCategory(id: number): (dispatch: Dispatch&lt;AnyAction&gt;) =&gt; void
  import deleteCategory
  Argument of type '(dispatch: Dispatch) =&gt; void' is not assignable to parameter of type 'AnyAction'.
    Property 'type' is missing in type '(dispatch: Dispatch) =&gt; void' but required in type 'AnyAction'.ts(2345)
  </code></pre>
  <p>Problematic code:</p>
  <pre><code>export function getCategoryList(
    categories: CategoryType[],
    dispatch: Dispatch
  ) {
    return categories.map((category: CategoryType) =&gt; ({
      ...category,
      onDelete: () =&gt; {
        dispatch(deleteCategory(category._id)); //FIXME: Fix this. Error Appears here
      },
    }));
  }
  </code></pre>
  <p>Implementation of deleteCategory:</p>
  <pre><code>export const deleteCategory = (id: number) =&gt; (dispatch: Dispatch) =&gt; {
    deleteCategoryAPI(id)
      .then(() =&gt; {
        dispatch({
          type: DELETE_CATEGORY,
          category: id,
        });
      })
      .catch((error) =&gt; console.error(error));
  };
  </code></pre>
  <p>Implementation of deleteCategoryAPI:</p>
  <pre><code>export async function addCategoryAPI(category: CategoryType) {
    return fetch(`${API_URL}/categories`, {
      method: &quot;POST&quot;,
      body: JSON.stringify(category),
      headers: { &quot;Content-Type&quot;: &quot;application/json; charset=UTF-8&quot; },
    }).then((response) =&gt; response.json());
  }
  </code></pre>
  <p>I am using problematic code here:</p>
  <pre><code>const categoryList = getCategoryList(categoryState, dispatch);
  ...
  return (
      &lt;List
        dataSource={categoryList}
        renderItem={({ name, onDelete }) =&gt; (
          &lt;List.Item&gt;
            &lt;CategoryItem name={name} onDelete={onDelete} /&gt;
          &lt;/List.Item&gt;
        )}
      /&gt;
    );
  </code></pre>
  <pre><code>function CategoryItem({ name, onDelete }: categoryItemPropsType) {
  </code></pre>
  <pre><code>export type categoryItemPropsType = {
    name: string;
    onDelete: () =&gt; void;
  };
  </code></pre>
  <p>What could be a problem? Spent several hours for that.
  The interesting thing is that when I call <code>dispatch(deleteCategory(category._id))</code> somewhere else in functional component e.g. it works without any problems.. Thank you very much!</p>