@ryantotweets
Ryan Toronto
9 months
Just published a Build UI recipe for this <Await> component. Absolutely love using this!
@ryantotweets
Ryan Toronto
10 months
Stole this idea from Remix: An <Await> component that suspends for a promise. The nice thing about this is it lets me try out different loading UIs before extracting and naming a new component, defining its props, and declaring its types.
9
13
135
6
14
127

Replies

@agusterodin
Jeff Rosen
9 months
@ryantotweets Is there a decent way to achieve this? - Always perform blocking SSR in server components only on initial page load (with all data baked into the page). - Perform non-blocking client side transitions and lazily fetch data with loading placeholders for all subsequent…
3
0
2
@ryantotweets
Ryan Toronto
9 months
@agusterodin Great question, love the idea. We'll try to implement this one next week :)
0
0
1
@1258632
justboulatbek
9 months
@ryantotweets is possible only in nextjs?
1
0
0
@ryantotweets
Ryan Toronto
9 months
@1258632 In the demo I'm using next, but it's possible just about everywhere. Any RSC implementation should support this and it can even be done in client components by refactoring the await to the upcoming `use` hook. Also possible in Remix w/ defer (that's where the idea came from!)
2
0
1
@bakemonospace
Bakemono (Fra) 👹
9 months
@ryantotweets Thanks for sharing!!
0
0
0
@mannybreno
Manny Becerra
9 months
@ryantotweets Niiiicce! 🔥
0
0
1
@ebey_jacob
Jacob.lol 🤣
9 months
@ryantotweets Nice, I'm glad to see others picking this pattern up.
0
0
1
@pablofm86
Pablo Fernández Mena
9 months
@ryantotweets Would `use` hook be a replacement for this pattern when available?
1
0
1