Server-Side Rendering and Live Queries

TanStack Start routes render on the server for the first pageload of a browsing session. Neither the React Query nor standard Convex useQuery() hooks kick off requests for this data during this initial SSR pass, but the React Query hook useSuspenseQuery() does. The React Query client is then serialized with whatever data was loaded to make it available in the browser at hydration time. This reduces rendering on the server and updating on the client from two steps to one step: isomorphic data fetching with a single hook.

Try reloading this page to see the difference between useSuspenseQuery() and useQuery().

7
User 7923/24/26, 1:31 AM

hey James; Could you let the customer know we've fixed their issue?

7
User 703/24/26, 1:31 AM

Hi James- I'll be late to make the meeting tomorrow morning

6
User 6443/24/26, 1:31 AM

hey Emma- Could you let the customer know we've fixed their issue?

7
User 7923/24/26, 1:31 AM

hi Emma; how was your weekend?

9
User 9903/24/26, 1:31 AM

hey James... how's the weather in SF?

8
User 8563/24/26, 1:31 AM

hello Jamie, I'll be late to make the meeting tomorrow morning

2
User 2793/24/26, 1:31 AM

hi Nipunn- Could you let the customer know we've fixed their issue?

7
User 7943/24/26, 1:31 AM

hello James... what's your favorite ice cream place?

7
User 7453/24/26, 1:31 AM

hey Jamie- what's your favorite ice cream place?

9
User 9563/24/26, 1:31 AM

hi Emma- what's your favorite ice cream place?

9
User 96163/22/26, 4:54 AM

Hi Nipunn; Could you let the customer know we've fixed their issue?

8
User 83403/20/26, 11:39 AM

hi Jamie, I'll be late to make the meeting tomorrow morning

4
User 45283/16/26, 7:28 AM

hello Nipunn- I'll be late to make the meeting tomorrow morning

4
User 45283/16/26, 7:28 AM

hi Jamie; I'll be late to make the meeting tomorrow morning

7
User 77943/16/26, 7:28 AM

hey James; what's your favorite ice cream place?

7
User 77943/16/26, 7:28 AM

hey Emma... how was your weekend?

5
User 50553/14/26, 8:33 PM

hello Nipunn, I'll be late to make the meeting tomorrow morning

5
User 50553/14/26, 8:33 PM

hey Nipunn! what's your favorite ice cream place?

5
User 50553/14/26, 8:33 PM

hello James! Could you let the customer know we've fixed their issue?

7
User 7113/14/26, 8:31 PM

hello James; how's the weather in SF?

1const { data } = useSuspenseQuery(convexQuery(
2 api.messages.listMessages,
3 { channel: "chatty" }
4))
1const { data, isPending } = useQuery(convexQuery(
2 api.messages.listMessages,
3 { channel: "chatty" }
4))

On the browser these queries resume their subscriptions which you can see by .

Another way to opt into server-side data loading is to load the query in a loader.

Learn More

TanStack Start SSR Guide