Skip to content

How does useSuspenseQuery behave during SSR in App Router? #9100

Answered by TkDodo
pepperdad asked this question in Q&A
Discussion options

You must be logged in to vote

Does useSuspenseQuery perform an API call during SSR?

yes, because client components also render on the server during SSR, and useSuspenseQuery throws a promise during render that nextJs picks up on.

Everything you said is expected. Please read the docs on SSR, especially the advanced ssr guide around streaming. You have to get data into the client cache somehow, and we offer multiple ways to do so.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@pepperdad
Comment options

@TkDodo
Comment options

Answer selected by pepperdad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants