【发布时间】:2020-07-24 07:59:27
【问题描述】:
嘿,伙计们,我刚刚从 Internet 下载了一些源文件,它使用带有 Next.js 的 redux thunk 来查看事情是如何工作的,然后在使用 npm run dev 运行它之后,项目成功运行,但随后在控制台中我不断收到此日志:
1. WrappedApp.getInitialProps wrapper got the store with state {
loginAndSignupReducer: [],
getCategoryReducer: { loading: false, err: false, data: [] },
MyStoryReducer: { loading: false, err: false, data: [] },
reportStoryReducer: { loading: false, err: false, data: [] },
getAllDetails: []
}
3. WrappedApp.getInitialProps has store state {
loginAndSignupReducer: [],
getCategoryReducer: { loading: false, err: false, data: [] },
MyStoryReducer: { loading: false, err: false, data: [] },
reportStoryReducer: { loading: false, err: false, data: [] },
getAllDetails: []
}
4. WrappedApp.render created new store with initialState {
loginAndSignupReducer: [],
getCategoryReducer: { loading: false, err: false, data: [] },
MyStoryReducer: { loading: false, err: false, data: [] },
reportStoryReducer: { loading: false, err: false, data: [] },
getAllDetails: []
}
这些东西首先被渲染,正因为如此。我还在页面源中将它们视为对象
我在下面分享了一张图片,请参考它,我在
标记中呈现了我的 id,但在这里我将其视为对象。
有没有人从哪里永久摆脱它们?
【问题讨论】:
标签: reactjs redux react-redux next.js redux-thunk