javascript - 使用来自 React-Redux 的状态时出现问题 ___ 属性 'cart' 在类型 'DefaultRootState' 上不存在 - 来自 MERN 项目
问题描述
根据 VS 代码,我得到的错误是 --- 属性 'productDetails' 在类型 'DefaultRootState' 上不存在
为了更详细地说明问题如下,我已经尝试了页面上给出的解决方案,但是没有一个对我有用。所以我的问题如下:
//While I am using
const productList = useSelector((state) => state.productList)
//I am getting that property does not exist. the codes can be seen from the below images
这是我尝试使用的文件 > const productList = useSelector((state) => state.productList
在第二张图片中可以清楚地看到错误“DefaultRootState”类型上不存在属性“购物车”.ts(2339)
这是一个 MERN 项目。
解决方案
推荐阅读
- c - 如果计算的变量不是整数,如何继续下一行代码
- html - 导航栏链接到内部 html 页面不起作用
- java - 声明的包“”与预期的包不匹配
- autodesk-forge - Forge 查看器是否支持 3ds Max VRay 渲染引擎?
- sql - 消息 207,级别 16,状态 1“无效的列名称‘名称’”
- python - 使 lambda 找到数字对的乘积
- python - 计算 csv 文件中的出现次数
- kubernetes - ubuntu 中的 kubernetes 和外部 DNS
- reactjs - react native flatlist 高度无法自动更改
- excel - 如何在 Excel 中计算样本子组内的相关性