我已经使用 npm
安装了 react-admin
并在构建之后,
我收到此错误:
node_modules/redux/index:没有导出成员“CombinedState”。 TS2694
它链接到文件:
declare const _default: import("redux").Reducer<import("redux").CombinedState<{
resources: any;
customQueries: any;
loading: any;
notifications: any;
references: any;
ui: any;
}>, import("redux").AnyAction>;
redux
中没有 CombinedState
,我该如何解决这个问题?
最佳答案
This sounds like a troubleshooting issue.
但首先要快速了解 CombinedState
在哪里源自,
我将根据实际文件进行解释。
...\node_modules\redux\index.d.ts [lines 35-56]
内,
您会注意到CombinedState
实际上是一个type
redux
内声明.
事实上,它确实被导出了!另请注意,所有
reducer
react-admin
使用的功能定义在ra-core
内,
一个包,其上react-admin
取决于。
在ra-core
内,检查文件夹...\esm\reducer
和...\lib\reducer
,这就是这一行:
import("redux").CombinedState
主要使用 - 意思是 CombinedState
正在导入。
可能的解决方案:
- 首先,请确认您的
react-admin
和redux
安装没有损坏。
您可能没有遇到过这种情况,但我经常因此不得不重新安装软件包。 - 检查
redux
使用的版本对应于react-admin
您正在使用的。
验证的最佳方法是查看package.json
react-admin demo 内的文件.
既然能用,那就万事大吉了吧!?
这些建议基于与 react-admin v3.2.1
的合作.
请告诉我们什么对您有帮助。谢谢。
关于reactjs - React-Admin安装错误: Has no exported member 'CombinedState' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60373783/