You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When PPR is enabled, there are two different versions of a segment's
data we can render: a static version (that may contain holes for the
dynamic parts) and a full version that contains everything. The static
version is prefetched before navigation, and the full version is only
loaded once the navigation occurs.
Both versions are stored on the Cache Node object. Inside LayoutRouter,
we must choose which version to render. We'll use an experimental
feature of React's `useDeferredValue` hook:
facebook/react#27500
```js
const dataToRender = useDeferredValue(fullData, prefetchedData)
```
React will coordinate when to switch from the prefetch data to the full
data. For example, if the prefetch data is unable to finish rendering
(this would happen if the segment contained dynamic data that was not
wrapped in a Suspense boundary), it knows to switch to the full data
even though the first render did not commit.
0 commit comments