Understanding whether a fetch is made on the server
Hi there,
Sorry if this is a noob question. I have a call that I only intend to make client-side (don't want it during SSR) and am trying to figure out whether a fetch is being made.
I can see that during SSR isFetching gets set to true, which implies I am making an unneeded fetch on the server? I don't want to use hydration or initialData or anything for this one, just make the call client-side.
3 Replies
exotic-emeraldOP•3y ago
Is an option just to do something like: ? Do I need to add that?
complex-teal•3y ago
queries don't run on the server unless you expclicitly prefetch, or you use suspense and have a framework that can do streaming (like next13+ app dir)
exotic-emeraldOP•3y ago
Thanks @TkDodo 🔮 !