mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
When a component suspends and is replaced by a fallback, we should start prerendering the fallback immediately, even before any new data is received. During the retry, we can enter prerender mode directly if we're sure that no new data was received since we last attempted to render the boundary. To do this, when completing the fallback, we leave behind a pending retry lane on the Suspense boundary. Previously we only did this once a promise resolved, but by assigning a lane during the complete phase, we will know that there's speculative work to be done. Then, upon committing the fallback, we mark the retry lane as suspended — but only if nothing was pinged or updated in the meantime. That allows us to immediately enter prerender mode (i.e. render without skipping any siblings) when performing the retry. |
||
|---|---|---|
| .. | ||
| npm | ||
| src | ||
| index.js | ||
| package.json | ||
| README.md | ||
react-cache
A basic cache for React applications. It also serves as a reference for more advanced caching implementations.
This package is meant to be used alongside yet-to-be-released, experimental React features. It's unlikely to be useful in any other context.
Do not use in a real application. We're publishing this early for demonstration purposes.
Use it at your own risk.
No, Really, It Is Unstable
The API may will change wildly between versions.