My Authors
Read all threads
Lots of talk about React suspense today. I’m very excited about it.

However, I feel like the patterns I’ve seen in #ReactQuery (and friends like SWR) have alone been more transformative for my own dev process and users and have even prepped me for suspense in a lot of ways.
Of course, Suspense isn’t out yet, and the ecosystem will likely experience a smash of collective inovation around it when it comes out. That’s the exciting part. But what I feel like I’m starting to realize after playing around with it is that in the end,
The biggest thing that suspense is going to do for me is just one thing: avoiding that flash of loading/placeholder for newly mounted components. Suspense doesn’t fetch, it doesn’t codesplit, it doesn’t preload for you and it doesn’t cache for you.
It’s really only about smoothing out the experience of moving from state to state without seeing a loading placeholder. And I am all for it! I hate those loading flashes.

But if I’m being honest, I think caching and prefetching are WAY more important than that UX quirk.
The fact that suspense will depend on data loading, prefetching, caching, etc to be used to its fullest potential is the most curious piece of it all. We’re all waiting for suspense to happen. It will. But then what? At that point everyone will be reaching for three things:
1. Automatic code and data splitting.

2. The ability to prefetch that code and data in a reliable way.

3. Data caching layer.
I’m working from the bottom up with #ReactQuery. And already getting so many benefits without even thinking about suspense or code splitting. I’m also using Next.js from the top down to take care of as much code/data splitting and prefetching when I need it.
Which brings me to my point: I don’t feel like I’m really missing out on that much right now. The occasional flash of loading placeholder 🤷‍♂️ I can live with that. Heck, if it’s that important, prefetch it earlier! Don’t need suspense for that.
You don’t need anything more than we have already to start caching, prefetching, code/data splitting, etc.
All concepts that have been possible even before things like hooks rocked our world. You don’t need to wait for suspense to make your UX faster and better. In fact, you shouldn’t. Take advantage of this time waiting for it and get a step ahead of it.
Future you will be grateful. And you’ll be surprised at how far some caching and prefetching go. So far that, like me, you might forget about suspense for now, because you won’t need it nearly as much. Then when it comes, you’ll be even more ready!

#TanStack #react #myTEDtalk
Missing some Tweet in this thread? You can try to force a refresh.

Keep Current with Tanner Linsley ⚛️

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!