Typescript 为什么mapStateToProps具有Eslint警告';返回承诺的函数必须是异步的';?
我收到了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
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将使其成为返回函数的承诺