How to use RTQ with SSG? #2806
Unanswered
michalvadak
asked this question in
Q&A
Replies: 1 comment 15 replies
-
Did you check SSR with Next.js in the docs? Any of these should work export const getServerSideProps = wrapper.getServerSideProps(
(store) => async (context) => {
store.dispatch(apiName.endpoints.queryNameToRunInSSR.initiate());
await Promise.all(apiName.util.getRunningOperationPromises());
return {
props: {},
};
},
); export const getStaticProps = wrapper.getStaticProps(
(store) => async (context) => {
store.dispatch(apiName.endpoints.queryNameToRunInSSR.initiate());
await Promise.all(apiName.util.getRunningOperationPromises());
return {
props: {},
};
}); |
Beta Was this translation helpful? Give feedback.
15 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I can't really get it to work. Should I use
refetchOnMountOrArgChange
as I found in redux-toolkit documentation? Orrevalidation
from Next.js?Beta Was this translation helpful? Give feedback.
All reactions