Disabling `useSuspenseQuery` on the server with TanStack Start
Hey!
I'm using TanStack Start + Query together, using suspense everywhere, and have a long-running query that I don't want running in SSR. I'd rather it just run on the client.
I originally thought I could just disable the query, but found
enabled
is not a supported property with useSuspenseQuery
.
I understand the reasoning for this but not sure how I can go about selectively disabling the query from running in SSR? I also thought I could return undefined
but this doesn't quite feel right.2 Replies
correct-apricot•3w ago
You would need to not render the component I think, or let it run but have it error on the server
flat-fuchsiaOP•3w ago
I don't know why I didn't think of that 🤦♂️ thanks @TkDodo 🔮