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().

8
User 87117/2/25, 6:55 PM

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

8
User 87117/2/25, 6:55 PM

hi Nipunn, what's your favorite ice cream place?

1
User 19167/1/25, 4:59 PM

hi Jamie- how was your weekend?

5
User 57547/1/25, 2:44 AM

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

6
User 66476/28/25, 8:21 AM

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

6
User 66476/28/25, 8:21 AM

hey James; how's the weather in SF?

6
User 66476/28/25, 8:21 AM

Hi Emma- how was your weekend?

6
User 66476/28/25, 8:21 AM

hi Emma, Could you let the customer know we've fixed their issue?

6
User 66476/28/25, 8:21 AM

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

1
User 1176/28/25, 6:15 AM

Hi James- how was your weekend?

3
User 3476/28/25, 6:15 AM

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

2
User 2896/28/25, 6:15 AM

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

6
User 6136/28/25, 6:15 AM

hi Nipunn... I'll be late to make the meeting tomorrow morning

1
User 1656/28/25, 6:15 AM

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

3
User 3196/28/25, 6:15 AM

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

1
User 146/28/25, 6:15 AM

hello James; I'll be late to make the meeting tomorrow morning

3
User 3556/28/25, 6:15 AM

hello Jamie! how was your weekend?

3
User 3856/28/25, 6:15 AM

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

8
User 846/28/25, 6:15 AM

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

9
User 95336/28/25, 6:15 AM

hey James... how was your weekend?

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