Skip to content

Commit 78b9eac

Browse files
committed
update suspense doc
1 parent 15050aa commit 78b9eac

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

content/docs/reference-react.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,19 @@ It is documented in our [code splitting guide](/docs/code-splitting.html#reactla
370370

371371
While this is not supported today, in the future we plan to let `Suspense` handle more scenarios such as data fetching. You can read about this in [our roadmap](/blog/2018/11/27/react-16-roadmap.html).
372372

373-
>Note:
374-
>
375-
>`React.lazy()` and `<React.Suspense>` are not yet supported by `ReactDOMServer`. This is a known limitation that will be resolved in the future.
373+
#### `React.Suspense` in SSR
374+
During SSR trees wrapped in Suspense are rendered synchronously as deeply as possible. If the boundary never suspends
375+
then the tree renders as though the boundary were never there. If a component does suspend then we schedule a low
376+
priority task to render the fallback instead. If the component unsuspends before we flush the fallback then we send
377+
down the actual content and throw away the fallback.
378+
379+
#### `React.Suspense` during hydration
380+
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
381+
a higher priority than neighboring boundaries but discrete events (eg. click) will not be replayed upon hydration. Only
382+
the last continuous event (`focusin`, `mousein`, `dragenter`, `mouseover`, `pointerover`, `gotpointercapture`, `hover`)
383+
will be replayed.
384+
385+
376386

377387
### `React.startTransition` {#starttransition}
378388

0 commit comments

Comments
 (0)