
React Best Practices with Kent Dodds (Repeat)
JavaScript Archives - Software Engineering Daily
00:00
Hook and Racks With the Suspense Moon
Suspense is actually a supported feature to day, and it's been around for over a year. Using those two together is what gets you all of these extra super powers. You can use suspense with class components just find there's really nothing about the two of em. The only relation that they have is that you can have a custom hook that is responsible for suspending component. But inside of your component, when before you return your j s x, while you are in that render phase, you create a promise which will be caught by react. So i get the similar response to when people see j s x for the first time. They're like, weight, that feels very wrong.
Transcript
Play full episode