You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I decided that Suspend is crucial for best DX and UX and it's finally a time to learn it properly and use it in production, sooo here we go again, me with the questions :)
In this section https://reactjs.org/docs/concurrent-mode-suspense.html#approach-3-render-as-you-fetch-using-suspense
It starts to fetch early and then kinda accesses data in the underlying components.
I guess it's something that easy to achieve with useFragment of Relay where each component has its own props it depends on and, especially with streaming, it enables to progressively render component starting very early, as I guess useFragment suspends components from rendering until these dependencies are resolved.
How to do that with urql?
Start at the very root, and then re-query them in the underlying components using the same queries, but wrapped in Suspense letting dedupe doing its job?
Just a clue.
I wondering if some sort of wrapper with jotai may help me achieve that so I can subscribe to the async suspendable atom that will suspend the rendering of underlying components artificially until urql's data is there.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey, I decided that Suspend is crucial for best DX and UX and it's finally a time to learn it properly and use it in production, sooo here we go again, me with the questions :)
In this section https://reactjs.org/docs/concurrent-mode-suspense.html#approach-3-render-as-you-fetch-using-suspense
It starts to fetch early and then kinda accesses data in the underlying components.
I guess it's something that easy to achieve with
useFragment
of Relay where each component has its own props it depends on and, especially with streaming, it enables to progressively render component starting very early, as I guessuseFragment
suspends components from rendering until these dependencies are resolved.How to do that with
urql
?Start at the very root, and then re-query them in the underlying components using the same queries, but wrapped in
Suspense
letting dedupe doing its job?Just a clue.
I wondering if some sort of wrapper with
jotai
may help me achieve that so I can subscribe to the async suspendable atom that will suspend the rendering of underlying components artificially until urql'sdata
is there.Beta Was this translation helpful? Give feedback.
All reactions