![](/img/trans.png)
[英]How to access query params inside getServerSideProps in Next.js?
[英]How to access updated redux store state in getServerSideProps next js?
我正在尝试在 getServerSideProps 中获取最新的 redux state,如下所示:
export const getServerSideProps = async (ctx) => {
const state = store.getState();
console.log(state.name);
return { props: { login: false } };
};
但我得到的结果是初始名称 state。
如何在 getServerSideProps next js 中获取最新的持久化 redux state?
我想我只能通过为下一个 js 使用最新的 redux 配置来访问最新的 redux 状态,该配置可在此处获得:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.