store.ts 里的RootState报错

来源:11-11 【redux-persist】登录持久化

慕仔5555278

2021-02-19

store.ts 里的export type RootState = ReturnType

写回答

3回答

慕仔5555278

提问者

2021-02-20

export type RootState = ReturnType<typeof store.getState>

应该改成

export type RootState = ReturnType<typeof persistedReducer>


0
1
阿莱克斯刘
我估计可能是你在redux的其他相关文件中引用了RootState。虽然课程代码不会出现环形引用的问题,但是你的修改是正确的。使用 export type RootState = ReturnType 或者 export type RootState = ReturnType 都是可以的。
2021-02-21
共1条回复

慕仔5555278

提问者

2021-02-20

报错截图://img.mukewang.com/szimg/60305ed709a2541e08540866.jpg

0
0

阿莱克斯刘

2021-02-20

可以截个图看看报错信息吗?

0
0

React18 系统精讲 结合TS打造旅游电商平台

React18 精讲 + 结合 TS 实战 + 热门业务开发,获取必备技能

1993 学习 · 1015 问题

查看课程