-
In the SSR guide, and examples I have seen it's normally encouraged to re-use the same function
Next.js tries to encourage the idea that all your sensitive code should live inside getStaticProps, because the content of that function gets removed during the build process. This is very useful when you are using Database queries, or fetching from private BasicAuth backend APIs. What is the recommended approach to this with React-Query ? A naive approach to fix this would be
But people might not be aware that
Opinions? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
as pointed out on twitter, I think we should change the example to use two different methods of data fetching for server and client, similar to what swr does: https://swr.vercel.app/docs/with-nextjs#pre-rendering-with-default-data maybe something like:
note that the methods are now called |
Beta Was this translation helpful? Give feedback.
as pointed out on twitter, I think we should change the example to use two different methods of data fetching for server and client, similar to what swr does: https://swr.vercel.app/docs/with-nextjs#pre-rendering-with-default-data
maybe something like: