【发布时间】:2020-03-30 17:11:15
【问题描述】:
我在 react-native android 应用程序中使用 sendbird 聊天。为了提高聊天感知速度,我让用户查看以前的数据并异步加载更新(不显示加载器)。
我正在使用带有 redux-persist 的 sendbird 并保存整个 Chat 减速器对象。大多数 reducer 代码取自 https://github.com/sendbird/SendBird-JavaScript/tree/master/react-native-redux-sample。
数据已成功从持久状态中拉回。但它在渲染时失败。 isUserMessage、isFileMessage 等函数不存在。
我试图找到这些函数的定义位置,但除了type definitions 之外找不到任何东西。
有没有一种好方法可以从序列化的 JSON 构造整个 redux 状态?
如果您需要更多信息,请告诉我。
【问题讨论】:
标签: reactjs react-native redux redux-persist sendbird