Replies: 1 comment
-
Hi, thanks for opening this up.
This will be a big change, and we should give migration path. It's on my action items. I'll ask for help when something is ready to play with. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In order to use async atoms without
Suspense
, we can wrap them with theloadable
API.The issue with the urql integration using the
loadable
API is that the resultAtom value is always a promise, so the loadable atom value will always be{ state: 'loading' }
during SSR even if the data is prefetched.If it's possible to get a sync snapshot during SSR (perhaps by passing a suspense: false arg), then resultAtom could be the prefetched result instead of a promise. I imagine something similar to react urql
useQuery
hookhttps://github.com/FormidableLabs/urql/blob/bea39c2eb4a93669f5d1d4ee775dfc45cf56a39d/packages/react-urql/src/hooks/useQuery.ts#L99
FYI: SSR prefetching works with jotai query and
loadable
API.Beta Was this translation helpful? Give feedback.
All reactions