Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Soften language around suspense #1187

Merged
merged 3 commits into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions content/en/guide/v10/switching-to-preact.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function App() {

> Keep in mind that due to Preact reusing the browser's event system, events won't bubble up through a Portal container to the other tree.

## Suspense (experimental)
## Suspense

The main idea behind `Suspense` is to allow sections of your UI to display some sort of placeholder content while components further down the tree are still loading. A common use case for this is code-splitting where you'll need to load a component from the network before you can render it.

Expand All @@ -139,4 +139,6 @@ const SomeComponent = lazy(() => import('./SomeComponent'));

In this example the UI will display the `loading...` text until `SomeComponent` is loaded and the Promise is resolved.

> This feature is experimental and may contain bugs. We have included it as an early preview to increase testing visibility. We don't recommend using it in production.
> Suspense in both React and Preact isn't quite finalized or set it stone as of yet. While the React team still actively discourages users interfacing with it directly for data fetching, it's a pattern some Preact users have been happily using over the last few years. There are a few known issues (please see [our tracker](https://github.com/preactjs/preact/issues?q=is%3Aissue+is%3Aopen+suspense) for an up-to-date reference) but it's generally considered stable enough for use in production if you so wish.
>
> This site, for instance, is built using a Suspense-based data fetching strategy used to load all content you see.