Chapter 9. Suspense
This is the least important chapter in this book. At least, that’s what we’ve been told by the React team. They didn’t specifically say, “this is the least important chapter, don’t write it.” They’ve only issued a series of tweets warning educators and evangelists that much of their work in this area will very soon be outdated. All of this will change.
It could be said that the work the React team has done with Fiber, Suspense, and concurrent mode represents the future of web development. This work may change the way browsers interpret JavaScript. That sounds pretty important. We’re saying that this is the least important chapter in this book because the community hype for Suspense is high; we need to say it to balance out your expectations. The APIs and patterns that make up Suspense are not the single overarching theory that defines how all things large and small should operate.
Suspense is a just a feature. You may not ever need to use it. It’s being designed to solve specific problems that Facebook experiences working at scale. We don’t all have the same problems as Facebook, so we may want to think twice before reaching for those tools as the solution to all our problems. They may unnecessarily introduce complexity where complexity is not needed. Plus, this is all going to change. Concurrent mode is an experimental feature, and the React team has issued stern warnings about trying to use it in production. In fact, most of these concepts involve using hooks. ...
Get Learning React, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.