Advanced SSR - is queryFn on the client redundant?
Hey there, I am trying to set up for my project that I have been working on ssr with
Looking through the documentation, I found the following resource (https://tanstack.com/query/latest/docs/framework/react/guides/advanced-ssr).
In my use case, I am implementing the app router, but what is confusing me is the code that is run on the client.
Why does the queryFn needs to be passed again on the client? The data is passed from the server, without having the query function set. (Example: https://codesandbox.io/p/devbox/gifted-colden-dgmk45, check the
Thank you in advance, hope my question is clear enough
tanstack/react-query and Next.jsLooking through the documentation, I found the following resource (https://tanstack.com/query/latest/docs/framework/react/guides/advanced-ssr).
In my use case, I am implementing the app router, but what is confusing me is the code that is run on the client.
Why does the queryFn needs to be passed again on the client? The data is passed from the server, without having the query function set. (Example: https://codesandbox.io/p/devbox/gifted-colden-dgmk45, check the
movie/Movies.tsx file). Thank you in advance, hope my question is clear enough