1. 程式人生 > >React Suspense with the Fetch API

React Suspense with the Fetch API

React Suspense with the Fetch API

Dan Abramov, in response to a React developer asking why Suspense was not responding to the fetch API.

From the legend Dan Abramov himself, we receive such gems as “There is [no data fetching solution compatible with React Suspense] that exists yet,” and “[React Cache] will be the first one,” and “Suspense is limited to code splitting.” If I have one thing to tell Daniel “Abra Cadabra” Abramov, besides how impressed I am with his work, it’s this:

“No.”

Let’s reveal the magic behind the curtain that is React Suspense. For educational purposes, I’ll cover how I created this package.

Shut Up and Give Me the Package!