Skip to content

Is atomWithQuery dependant on Suspense? #613

Closed Answered by dai-shi
marcselman asked this question in Q&A
Discussion options

You must be logged in to vote

Async atoms require Suspense (for lazy loading, experimental for data) and minimal requirement is react 16.8 (no dependency on react-dom.) However, ReactDOMServer doesn't support Suspense, so it needs some techniques to avoid Suspense with async atoms in SSR. (It's like providing initial data, but documentation for SSR is still TODO.)

atomWithQuery is originally designed with async atoms, but afterwards @aulneau improved it. Now, with initialData, it doesn't depend on async atoms. (and it's not yet documented.)

So, your simple question reveals some doc issues. Thanks for it.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by marcselman
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