Property '[Symbol.observable]' is missing in type 'Store<ApplicationState>' but required in type 'Store<any, AnyAction>'. TS2741

你。 提交于 2020-01-03 20:03:17

问题


I've got this error after update @react-material/core, and I don't know how to resolve this.

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),
    );

This is the error:

ErrorImage

I'm just trying to resolve this to generate a new version. Any ideas?

Thanks!


回答1:


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>



回答2:


You should update redux to 4.0.3 (see: https://github.com/reduxjs/redux/issues/3466)



来源:https://stackoverflow.com/questions/56961024/property-symbol-observable-is-missing-in-type-storeapplicationstate-but

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!