Closed natekfl closed 11 months ago
That is a very good point, we should move that to a useMemo
as well I suppose 😅 the most important one in this case would be to re-create the ssrExchange
as that would be the one persisting data across invocations if the server lives for multiple requests.
In the docs for Next.js SSR, there is this example:
However, as written, the server develops a cache across requests, since ssr and client are declared outside of any react component. These should be moved to inside of the component, so that a new client is used for each new request on the server side.
(I may also be misunderstanding something around ssr, and if that's the case please let me know. However when I followed the docs as listed, I ran into caching issues)