meta_pixel
Tapesearch Logo
Log in
Syntax - Tasty Web Development Treats

Hasty Treat - React Suspense

Syntax - Tasty Web Development Treats

Wes Bos

Tech News, Technology, News

4.9 • 1.2K Ratings

🗓️ 18 March 2019

⏱️ 21 minutes

🧾️ Download transcript

Summary

In this Hasty Treat, Scott and Wes talk about React Suspense — what it is, how it works, support and more! Sentry - Sponsor If you want to know what’s happening with your errors, track them with Sentry. Sentry is open-source error tracking that helps developers monitor and fix crashes in real time. Cut your time on error resolution from five hours to five minutes. It works with any language and integrates with dozens of other services. Syntax listeners can get two months for free by visiting Sentry.io and using the coupon code “tastytreat”. Show Notes Not live yet - it may/will change. Be warned! 3:59 - The problem we have with React right now API calls Image loading Code splitting 7:16 - What is React Suspense? First we convert our async data fetching functions into resources Resources can then be read inside render - above the return Resources can be read from cache Resources can be preloaded into a cache if you anticipate needing them Resources reads are blocking for that function - you can’t return JSX until the resource is read In your component that fetches data, there is no need to maintain a loading state Then, anywhere higher up in that tree, you can introduce a suspense component The suspense component can detect if any of it’s children are currently loading data If they are, we can then choose to show a loader via the fallback prop We can also choose to show nothing via the maxDelay prop — this is helpful for fast connections that shouldn’t see the spinner for a short split-second 15:20 - Support React.lazy and suspense for code splitting is already here The React.lazy function lets you render a dynamic import as a regular component Loadable Components is recommended if you need splitting with SSR Data Resources is not here yet Links React 16.x Roadmap Tweet us your tasty treats! Scott’s Instagram LevelUpTutorials Instagram Wes’ Instagram Wes’ Twitter Wes’ Facebook Scott’s Twitter Make sure to include @SyntaxFM in your tweets

Transcript

Click on a timestamp to play from that location

0:00.0

Monday, Monday, Monday,

0:02.0

Open wide Dev fans.

0:04.0

Get ready to stuff your face

0:06.0

with JavaScript, CSS, node modules, barbecue tips,

0:09.0

get workflows,

0:10.0

break dancing, soft skills, web development,

0:12.0

the hastiest, the craziest, the craziest development the hastiest the craziest the tastiest web development treats coming in hot here is

0:18.1

Wes Barracuda bars and Scott El Torloco, Tolinsky.

0:25.0

Welcome to Syntax in this Monday hasty treat.

0:30.0

We are going to be talking all about react suspense and largely about the future of

0:34.7

react as we talk a little bit about the roadmap here of what we're going to be seeing out of

0:39.2

react over the next few months here and how it's going to evolve. Now my name is

0:44.1

Scott Tolinsky and with me as always is Wes Boss. Hey everybody. Hey Wes.

0:48.6

This episode is sponsored by one of our favorite sponsors over here which is

0:52.2

Century.

0:53.2

Now Century is a great way to track all of your bugs and let you be aware of the things that

0:59.8

are happening on your site. Like right now I just pulled open my Century dashboard. I see an

1:04.4

error here. Can I read property name of Null which means that I probably

1:08.9

forgot to check to see if something existed first and now that's something I'm

1:12.4

going to want to take care of

1:13.4

immediately following this, this podcast recording episode.

1:16.8

And one of the cool things that's that Century allows me to do is

...

Please login to see the full transcript.

Disclaimer: The podcast and artwork embedded on this page are from Wes Bos, and are the property of its owner and not affiliated with or endorsed by Tapesearch.

Generated transcripts are the property of Wes Bos and are distributed freely under the Fair Use doctrine. Transcripts generated by Tapesearch are not guaranteed to be accurate.

Copyright © Tapesearch 2026.