DEV Community

Cover image for Learn Suspense by Building a Suspense-Enabled Library
Slava
Slava

Posted on • Originally published at bbss.dev on

Learn Suspense by Building a Suspense-Enabled Library

Suspense (along with concurrent rendering) has been a feature in React since v16.6.0. Despite this, I haven’t seen much of it in action beyond React.lazy and limited applications of “suspense-enabled libraries”.

What’s going on?

As of the impending React v19 release, Suspense is still not quite ready for primetime. The story of its APIs and internals still seems incomplete. In fact, the React team seems to think it’s so incomplete that the Suspense API is entirely undocumented. The Suspense documentation insists that the only way of using Suspense is via “Suspense-enabled frameworks”.

I think that purposefully hiding APIs in documentation is silly, but fine! I’ll play their game! Let’s build a Suspense-enabled library, and use it.

We will peel back the curtain of Suspense along the way.

Read more: https://www.bbss.dev/posts/react-learn-suspense/

Top comments (0)