【问题标题】:NextJS with Redux - store is empty after initializingNextJS with Redux - 初始化后存储为空
【发布时间】:2020-01-23 14:45:21
【问题描述】:

使用以下示例:

https://github.com/zeit/next.js/tree/canary/examples/with-redux-wrapper

页面被刷新后,getInitialProps 被调用并且存储被填充初始状态。但仅限于服务器端。当客户端存储为空并且初始状态传递一个道具时。有没有办法再次使用初始状态设置存储状态,或者我该怎么办?

【问题讨论】:

  • 您好,您解决了这个问题吗?

标签: redux next.js


【解决方案1】:

你应该在这个例子中使用 redux persist

https://github.com/zeit/next.js/tree/canary/examples/with-redux-persist

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-12-06
    • 2016-11-09
    • 1970-01-01
    • 2014-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多