Mention use as a Suspense-enabled data source (#6340)

Maybe it's debatable whether we want to link to canary APIs in other pages but I feel like here it's more useful than not.
This commit is contained in:
Sophie Alpert
2023-10-05 22:55:01 -07:00
committed by GitHub
parent c45fa10a95
commit 3cd1723658
4 changed files with 5 additions and 1 deletions

View File

@@ -288,6 +288,7 @@ Streaming does not need to wait for React itself to load in the browser, or for
- Data fetching with Suspense-enabled frameworks like [Relay](https://relay.dev/docs/guided-tour/rendering/loading-states/) and [Next.js](https://nextjs.org/docs/getting-started/react-essentials)
- Lazy-loading component code with [`lazy`](/reference/react/lazy)
- Reading the value of a Promise with [`use`](/reference/react/use)
Suspense **does not** detect when data is fetched inside an Effect or event handler.

View File

@@ -287,6 +287,7 @@ Streaming does not need to wait for React itself to load in the browser, or for
- Data fetching with Suspense-enabled frameworks like [Relay](https://relay.dev/docs/guided-tour/rendering/loading-states/) and [Next.js](https://nextjs.org/docs/getting-started/react-essentials)
- Lazy-loading component code with [`lazy`](/reference/react/lazy)
- Reading the value of a Promise with [`use`](/reference/react/use)
Suspense **does not** detect when data is fetched inside an Effect or event handler.

View File

@@ -254,6 +254,7 @@ async function getAlbums() {
- Data fetching with Suspense-enabled frameworks like [Relay](https://relay.dev/docs/guided-tour/rendering/loading-states/) and [Next.js](https://nextjs.org/docs/getting-started/react-essentials)
- Lazy-loading component code with [`lazy`](/reference/react/lazy)
- Reading the value of a Promise with [`use`](/reference/react/use)
Suspense **does not** detect when data is fetched inside an Effect or event handler.

View File

@@ -82,10 +82,11 @@ During updates, the <CodeStep step={2}>deferred value</CodeStep> will "lag behin
<Note>
This example assumes you use one of Suspense-enabled data sources:
This example assumes you use a Suspense-enabled data source:
- Data fetching with Suspense-enabled frameworks like [Relay](https://relay.dev/docs/guided-tour/rendering/loading-states/) and [Next.js](https://nextjs.org/docs/getting-started/react-essentials)
- Lazy-loading component code with [`lazy`](/reference/react/lazy)
- Reading the value of a Promise with [`use`](/reference/react/use)
[Learn more about Suspense and its limitations.](/reference/react/Suspense)