Redux-saga和Typescript错误:无法调用类型缺少呼叫签名的表达式

时间:2019-05-24 05:07:19

标签: typescript redux-saga

当我声明createSagaMiddleware()函数时,我的商店配置中的以下代码会产生以下错误:

Cannot invoke an expression whose type lacks a call signature. Type 'typeof import("/myProject/node_modules/redux-saga/index")' has no compatible call signatures

我不确定这是什么意思。在redux-saga软件包和redux-saga文档中没有什么细节。

import createSagaMiddleware from 'redux-saga';
const sagaMiddleware = createSagaMiddleware();
const loggerMiddleware = createLogger();

export default function configureStore(preloadedState: any) {
  return createStore(
    rootReducer,
    preloadedState,
    applyMiddleware(sagaMiddleware, loggerMiddleware)
  )
}

0 个答案:

没有答案