React suspense is a thing in react which will allow you to suspend sort of pause a component while that component is doing something like fetching data. So basically the basics are you have essentially your normal component, right? It's a Function it's a component and we're used to doing our way of using a a promise where you'd have a use effect That would fetch data from an API or load from a database or something like that. The idea is that you can suspend that component you give it a like ah suspend this for two seconds And if you don't have your data by then then then throw a loader in there and that will show your actual instead of nothing.
In this Hasty Treat, Scott and Wes talk about the new proposal for React, what the basics of it are, why it’s being proposed, and some benefits and issues it brings up.
Sentry - Sponsor
If you want to know what’s happening with your code, track errors and monitor performance with Sentry. Sentry’s Application Monitoring platform helps developers see performance issues, fix errors faster, and optimize their code health. Cut your time on error resolution from hours to minutes. It works with any language and integrates with dozens of other services. Syntax listeners new to Sentry can get two months for free by visiting Sentry.io and using the coupon code TASTYTREAT during sign up.
Auth0 - Sponsor
Auth0 is the easiest way for developers to add authentication and secure their applications. They provides features like user management, multi-factor authentication, and you can even enable users to login with device biometrics with something like their fingerprint. Not to mention, Auth0 has SDKs for your favorite frameworks like React, Next.js, and Node/Express. Make sure to sign up for a free account and give Auth0 a try with the link below. https://a0.to/syntax
Show Notes
Tweet us your tasty treats