当我声明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)
)
}