Skip to content

Question: useQuery and async #1002

Answered by flybayer
netheril96 asked this question in General
Discussion options

You must be logged in to vote

Good question! The short answer is because it use React Suspense (concurrent mode).

So while the network request is inflight, it triggers suspense which wall cause the fallback component on the nearest <Suspense fallback={/*stuff*/}> component.

So the component render basically stops at the useQuery call until the promise is resolved. Once resolved, then the component will fully render.

Does that makes sense?

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@netheril96
Comment options

@flybayer
Comment options

@flybayer
Comment options

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