【发布时间】:2021-02-10 22:27:51
【问题描述】:
我有一个像这样的React 操作:
export const sigIn = () =>
async (dispatch: any) => {
dispatch({
type: SIGN_IN_REQUEST
});
};
我得到一个:
ESLint: Argument 'dispatch' should be typed with a non-any type.(@typescript-eslint/explicit-module-boundary-types)
作为async 上的警告。为什么?
编辑:对于这两个答案,我从 redux 输入了 Dispatch 类型,但我仍然有警告:
【问题讨论】:
标签: reactjs typescript typescript-typings