Skip to content

Commit 35abef0

Browse files
committed
Clarify conditional query rendering
1 parent 64c6968 commit 35abef0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/content/reference/react-dom/browser.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export default function SavedDraft() {
234234
235235
---
236236
237-
### Conditionally rendering on the server {/*conditionally-rendering-in-the-browser*/}
237+
### Conditionally rendering on the server {/*conditionally-rendering-on-the-server*/}
238238
239239
Unlike Hooks, [`use`](/reference/react/use) can be called inside a conditional statement or after an early return.
240240
@@ -402,9 +402,9 @@ function ProductDetails({ productId, initialData }) {
402402
}
403403
```
404404
405-
When `initialData` is provided, `useBrowserQuery` calls `useQuery` during server rendering, and React includes the rendered content in the HTML.
405+
When `initialData` is provided, `useBrowserQuery` skips the call to `use(browser())` and passes the initial data to `useQuery`. This lets the Component render on the server.
406406
407-
Without `initialData`, `useBrowserQuery` calls `use(browser())`, suspending the Component and leaving the closest [`<Suspense>`](/reference/react/Suspense) boundary's fallback in the HTML.
407+
Without `initialData`, `useBrowserQuery` calls `use(browser())`. React leaves the closest [`<Suspense>`](/reference/react/Suspense) boundary's fallback in the server-rendered HTML.
408408
409409
In the browser, `useBrowserQuery` calls `useQuery` in both cases, allowing the query library to fetch the data or read it from its client cache as usual.
410410

0 commit comments

Comments
 (0)