Skip to content

Commit

Permalink
Inline stylesheets are not Suspensey yet (#7378)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored Dec 19, 2024
1 parent 03e74dd commit 8e41e32
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/content/reference/react-dom/components/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ This special treatment comes with two caveats:

If a component depends on certain CSS styles in order to be displayed correctly, you can render an inline stylesheet within the component.

If you supply an `href` and `precedence` prop, your component will suspend while the stylesheet is loading. (Even with inline stylesheets, there may be a loading time due to fonts and images that the stylesheet refers to.) The `href` prop should uniquely identify the stylesheet, because React will de-duplicate stylesheets that have the same `href`.
The `href` prop should uniquely identify the stylesheet, because React will de-duplicate stylesheets that have the same `href`.
If you supply a `precedence` prop, React will reorder inline stylesheets based on the order these values appear in the component tree.

Inline stylesheets will not trigger Suspense boundaries while they're loading.
Even if they load async resources like fonts or images.

<SandpackWithHTMLOutput>

Expand Down

0 comments on commit 8e41e32

Please sign in to comment.