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
Copy file name to clipboardExpand all lines: src/content/reference/react-dom/browser.md
+54-31Lines changed: 54 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,24 +69,47 @@ Call `browser` inside `use` in a component that should only render in the browse
69
69
70
70
You can use this instead of checking `typeofwindow`, waiting for an [`Effect`](/reference/react/useEffect) to set mounted state, or using a framework option to disable server rendering.
71
71
72
-
Press **Render the page**. The loading fallback appears first. After a short delay, React hydrates the page and displays the browser-only editor.
72
+
Click **Reload** to see the loading fallback in the initial HTML. After hydration, React displays the draft loaded from `localStorage`.
@@ -243,18 +265,19 @@ On the server, `useBrowserQuery` calls `useQuery` only when `initialData` is ava
243
265
Pass an `onBrowserBailout` callback to the server renderer to report browser-only rendering. When React leaves a Suspense fallback for the browser, it does not call the server renderer's `onError` callback or [`hydrateRoot`'s `onRecoverableError`](/reference/react-dom/client/hydrateRoot#error-logging-in-production) callback. This example also passes a reason, which is available as the reported error's `cause`:
Copy file name to clipboardExpand all lines: src/content/reference/react/Suspense.md
+43-22Lines changed: 43 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2386,24 +2386,47 @@ The server HTML will include the loading indicator. It will be replaced by the `
2386
2386
2387
2387
A Suspense boundary can provide a fallback for a browser-only component. Wrap the component in `<Suspense>` and call [`use(browser())`](/reference/react/use#use-browser) inside it.
2388
2388
2389
-
Press **Render the page**. The loading fallback appears first. After a short delay, React hydrates the page and displays the browser-only editor.
2389
+
Click **Reload** to see the loading fallback in the initial HTML. After hydration, React displays the draft loaded from `localStorage`.
@@ -2486,8 +2507,8 @@ export async function flushReadableStreamToFrame(readable, frame) {
2486
2507
```css src/styles.css hidden
2487
2508
iframe {
2488
2509
width:100%;
2489
-
height:180px;
2490
-
border:1px solid #aaa;
2510
+
height:160px;
2511
+
border:0;
2491
2512
}
2492
2513
```
2493
2514
@@ -2509,7 +2530,7 @@ iframe {
2509
2530
2510
2531
</Sandpack>
2511
2532
2512
-
During server rendering, React includes the Suspense boundary's fallback in the HTML. In the browser, React replaces the fallback with the editor.
2533
+
During server rendering, React includes the Suspense boundary's fallback in the HTML. In the browser, React replaces the fallback with the saved draft.
0 commit comments