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
{{ message }}
Repository navigation
Commit 2b0bf46
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: src/content/reference/react/Suspense.md
+30-13Lines changed: 30 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2903,7 +2903,7 @@ Where you place the `<ViewTransition>` relative to the boundary determines wheth
2903
2903
2904
2904
When a [`<ViewTransition>`](/reference/react/ViewTransition) animates a Suspense boundary's reveal, React waits up to 500 ms for new fonts the content introduces so the text doesn't flash with a fallback font. This only happens during a `<ViewTransition>` update.
2905
2905
2906
-
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.
2906
+
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 while the font loads. If it loads within the 500 ms limit, the quote appears already in its font.
2907
2907
2908
2908
For comparison, the second button performs the same update without React. Nothing waits for the font, so the text appears in a fallback font first and then switches:
2909
2909
@@ -2922,7 +2922,7 @@ function Quote({ fontSrc }) {
2922
2922
<style href={fontSrc} precedence="default">
2923
2923
{`@font-face {
2924
2924
font-family: 'Fancy';
2925
-
src: url(${fontSrc}) format('truetype');
2925
+
src: url(${fontSrc}) format('woff2');
2926
2926
font-display: swap;
2927
2927
}`}
2928
2928
</style>
@@ -2967,7 +2967,7 @@ export default function VanillaQuote() {
2967
2967
conststyle=document.createElement('style');
2968
2968
style.textContent=`@font-face {
2969
2969
font-family: 'VanillaFancy';
2970
-
src: url(${freshFontUrl()}) format('truetype');
2970
+
src: url(${freshFontUrl()}) format('woff2');
2971
2971
font-display: swap;
2972
2972
}`;
2973
2973
document.head.appendChild(style);
@@ -2987,7 +2987,7 @@ export default function VanillaQuote() {
0 commit comments