Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typescript 为什么mapStateToProps具有Eslint警告';返回承诺的函数必须是异步的';?_Typescript_Eslint_Redux Form - Fatal编程技术网

Typescript 为什么mapStateToProps具有Eslint警告';返回承诺的函数必须是异步的';?

Typescript 为什么mapStateToProps具有Eslint警告';返回承诺的函数必须是异步的';?,typescript,eslint,redux-form,Typescript,Eslint,Redux Form,我收到了Eslint警告: Functions that return promises must be async. eslint(@typescript-eslint/promise-function-async) 关于功能: import { getFormValues, change } from 'redux-form'; function mapStateToProps(state: any, ownProps: IWizardPageProps) { const sta

我收到了Eslint警告:

Functions that return promises must be async.
eslint(@typescript-eslint/promise-function-async)
关于功能:

import { getFormValues, change } from 'redux-form';

function mapStateToProps(state: any, ownProps: IWizardPageProps) {
    const stateProps = getFormValues('wizard')(state);
    return {
        ...ownProps,
        ...stateProps,
        change,
    };
}

我不明白怎么了。我没有看到任何承诺。

redux表单本身依赖于承诺调用。因此,返回change或getFormValues将使其成为返回函数的承诺