angular - 使用 @angular-redux/store 时 Redux 4.0.0 出错
问题描述
在编译时出现以下错误:
ERROR in node_modules/@angular-redux/store/lib/src/components/ng-redux.d.ts(10,31): error TS2420: Class 'NgRedux<RootState>' incorrectly implements interface 'ObservableStore<RootState>'.
Types of property 'dispatch' are incompatible.
Type 'Dispatch<RootState>' is not assignable to type 'Dispatch<AnyAction>'.
Type 'RootState' is not assignable to type 'AnyAction'.
node_modules/@angular-redux/store/lib/src/components/ng-redux.d.ts(37,33): error TS2344: Type 'RootState' does not satisfy the constraint 'Action<any>'.
node_modules/@angular-redux/store/lib/src/components/root-store.d.ts(18,24): error TS2344: Type 'RootState' does not satisfy the constraint 'Action<any>'.
环境设置:
NodeJS 版本:8.9.1
打字稿版本:2.8.1
角度版本:5.0.0
@angular-redux/store 版本:7.1.1
操作系统:Windows 10
解决方案
@angular-redux/store github 页面确认这是一个错误,并将在未来的版本中修复。
到目前为止,将 Redux 版本从 4.0.0 降级到 3.7.0 解决了这个问题。
推荐阅读
- javascript - 验证表列
- bootstrap-4 - 如何在 Bootstrap 4 中将边距实用程序从 3rem 增加到更多?
- maven - Jenkins 为 Artifactory maven 工作
- python - 如何在熊猫中以特定方式旋转数据框
- python - 如何将自定义代码添加到 Swagger 生成的 Flask 代码中?
- mongodb - windows 7 dll缺失的mongodb安装错误
- django - Django:没有任何身份验证的post api的安全性
- python - 如何指定 pandas.to_datetime('now') 的格式
- android - 发布请求 JSON 返回 null
- sql - MS ACCESS 开关盒