Need staletime or SSR does not work correctly
Hey, my team and I were wondering why do we need a staletime OR refetchOnMount: false and refetchOnWindowFocus: false, to make the SSR work correctly ?
If we do not put it, double fetch : data is SSR but a query do trigger in network too. However in the tanstack start sample, there is no staletime nor refetch params to false in hooks and I don't get why. ( https://tanstack.com/start/latest/docs/framework/react/examples/start-basic-react-query?path=examples%2Freact%2Fstart-basic-react-query%2Fsrc%2Futils%2Fposts.tsx )
Heres our hook :
and where it's used :
Thank you if you take the time to help us
If we do not put it, double fetch : data is SSR but a query do trigger in network too. However in the tanstack start sample, there is no staletime nor refetch params to false in hooks and I don't get why. ( https://tanstack.com/start/latest/docs/framework/react/examples/start-basic-react-query?path=examples%2Freact%2Fstart-basic-react-query%2Fsrc%2Futils%2Fposts.tsx )
Heres our hook :
and where it's used :
Thank you if you take the time to help us