“Store<ApplicationState>"类型中缺少属性“[Symbol.observable]"但在“Store<any, AnyAction>"类型中是必需的.TS2741 [英] Property '[Symbol.observable]' is missing in type 'Store<ApplicationState>' but required in type 'Store<any, AnyAction>'. TS2741
问题描述
更新@react-material/core 后出现此错误,我不知道如何解决.
I've got this error after update @react-material/core, and I don't know how to resolve this.
我尝试更新 react-redux 和 redux-thunk 库,但没有成功.
I tried to update react-redux and redux-thunk libraries with no success.
这是我商店文件的一部分:
This is part of my store file:
const store = isDevMode
? createStore<ApplicationState>(
rootReducer,
initialState,
composeEnhancers(applyMiddleware(...middleware)),
)
: createStore<ApplicationState>(
rootReducer,
initialState,
applyMiddleware(...middleware),
);
这是错误:
我只是想解决这个问题以生成一个新版本.有什么想法吗?
I'm just trying to resolve this to generate a new version. Any ideas?
谢谢!
推荐答案
今天早上我遇到了这个问题.我尝试更新我的@types/react-redux,但没有任何运气.最终我只是将其添加为类型错误的解决方法:
I ran into this issue this morning. I tried updating my @types/react-redux, but wasn't having any luck. Eventually I just added this as a workaround to the type error:
<Provider store={store as any}>
<App />
</Provider>
这篇关于“Store<ApplicationState>"类型中缺少属性“[Symbol.observable]"但在“Store<any, AnyAction>"类型中是必需的.TS2741的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!