Skip to content

Commit

Permalink
[18] Updated Suspense doc with behavior during SSR and Hydration (#4484)
Browse files Browse the repository at this point in the history
* update wording

* wording

* update events

* Update content/docs/reference-react.md

Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>

* add link to selective hydration

* remove some of the implementation details

Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
  • Loading branch information
salazarm and eps1lon authored Mar 28, 2022
1 parent a9ea7fc commit 931e2fc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions content/docs/reference-react.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,14 @@ It is documented in our [code splitting guide](/docs/code-splitting.html#reactla
>
> For content that is already shown to the user, switching back to a loading indicator can be disorienting. It is sometimes better to show the "old" UI while the new UI is being prepared. To do this, you can use the new transition APIs [`startTransition`](#starttransition) and [`useTransition`](/docs/hooks-reference.html#usetransition) to mark updates as transitions and avoid unexpected fallbacks.

#### `React.Suspense` in Server Side Rendering
During server side rendering Suspense Boundaries allow you to flush your application in smaller chunks by suspending.
When a component suspends we schedule a low priority task to render the closest Suspense boundary's fallback. If the component unsuspends before we flush the fallback then we send down the actual content and throw away the fallback.
#### `React.Suspense` during hydration
Suspense boundaries depend on their parent boundaries being hydrated before they can hydrate, but they can hydrate independently from sibling boundaries. Events on a boundary before its hydrated will cause the boundary to hydrate at
a higher priority than neighboring boundaries. [Read more](https://github.com/reactwg/react-18/discussions/130)
### `React.startTransition` {#starttransition}
```js
Expand Down

0 comments on commit 931e2fc

Please sign in to comment.