Skip to content

Commit 049bd8e

Browse files
committed
Make section openers stand alone and restore demo timing
1 parent 50887a9 commit 049bd8e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/content/reference/react/Suspense.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2740,7 +2740,7 @@ Where you place the `<ViewTransition>` relative to the boundary determines wheth
27402740
27412741
### <CanaryBadge /> Waiting for a font to load {/*waiting-for-a-font-to-load*/}
27422742
2743-
When a [`<ViewTransition>`](/reference/react/ViewTransition) animates a Suspense boundary's reveal, React also waits for new fonts the content introduces, up to a timeout, so the text doesn't flash with a fallback font. This only happens during a `<ViewTransition>` update.
2743+
When a [`<ViewTransition>`](/reference/react/ViewTransition) animates a Suspense boundary's reveal, React waits for new fonts the content introduces, up to a timeout, so the text doesn't flash with a fallback font. This only happens during a `<ViewTransition>` update.
27442744
27452745
In the example below, the Suspense boundary is wrapped in a `<ViewTransition>`, and the `Quote` component suspends while its data loads. Rendering the quote starts its font download. React keeps the fallback visible until the font has loaded, so the quote appears already in its font.
27462746
@@ -2890,7 +2890,7 @@ hr {
28902890
28912891
### <CanaryBadge /> Waiting for an image to load {/*waiting-for-an-image-to-load*/}
28922892
2893-
Images work the same way: when a [`<ViewTransition>`](/reference/react/ViewTransition) animates a Suspense boundary's reveal, React waits for visible images to load, up to a timeout, so the animation doesn't start with a half-loaded image. This only happens during a `<ViewTransition>` update. Adding an `onLoad` handler opts a specific image out, even inside a `<ViewTransition>`.
2893+
When a [`<ViewTransition>`](/reference/react/ViewTransition) animates a Suspense boundary's reveal, React waits for visible images to load, up to a timeout, so the animation doesn't start with a half-loaded image. This only happens during a `<ViewTransition>` update. Adding an `onLoad` handler opts a specific image out, even inside a `<ViewTransition>`.
28942894
28952895
In the example below, the Suspense boundary is wrapped in a `<ViewTransition>` and shows a profile skeleton until the portrait has loaded.
28962896
@@ -3023,9 +3023,9 @@ hr {
30233023
30243024
### <CanaryBadge /> Coordinating fonts, images, and stylesheets {/*coordinating-fonts-images-and-stylesheets*/}
30253025
3026-
All of these waits work together. In the example below, the `ProfileCard` component suspends while its data loads, and renders a stylesheet with `precedence`, text in a new font, and a portrait. React keeps the skeleton visible while the data and the stylesheet load. The `<ViewTransition>` reveal then waits for the font and the image, so the card appears complete.
3026+
A single Suspense boundary can wait for several of these resources at once. In the example below, the `ProfileCard` component suspends while its data loads, and renders a stylesheet with `precedence`, text in a new font, and a portrait. React keeps the skeleton visible while the data and the stylesheet load. The `<ViewTransition>` reveal then waits for the font and the image, so the card appears complete.
30273027
3028-
For comparison, the second button performs the same update with plain DOM, without React. It loads the same data first, and then each resource pops in as it arrives:
3028+
For comparison, the plain DOM version loads the same data and shows every resource arriving on its own schedule:
30293029
30303030
<Sandpack>
30313031
@@ -3155,7 +3155,7 @@ export function freshImageUrl() {
31553155
export async function fetchQuote() {
31563156
// Add a fake delay to make waiting noticeable.
31573157
await new Promise((resolve) => {
3158-
setTimeout(resolve, 300);
3158+
setTimeout(resolve, 2000);
31593159
});
31603160
return 'The best way to predict the future is to invent it.';
31613161
}

0 commit comments

Comments
 (0)