![](/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.