Skip to content

Commit 47f81c4

Browse files
authored
docs: remove dangling whitespace in backticks (#217)
1 parent b7256c2 commit 47f81c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

text/0213-suspense-in-react-18.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Suspense lets you declaratively specify what React should show when a part of th
7070

7171
Conceptually, you can think of `Suspense` as being similar to a `catch` block. However, instead of catching errors, it catches components "suspending". Any component in the tree can "suspend", which means that it's not ready to render. (The reason is arbitrary, but usually it could be due to missing code, data, etc.)
7272

73-
In JavaScript, when you `throw`, the closest `catch` above "wins", even if it's several function calls higher. Although Suspense works differently under the hood, the mental model is similar: if a component suspends, the closest `Suspense` component above the suspending component "catches" it, no matter how many components that are in between. In the above example, if `ProfileHeader ` suspends, then the entire page will be replaced with the `PageGlimmer`. However, if either `Comments` or `Photos` suspend, they together will be replaced with the `LeftColumnGlimmer`. This lets you safely add and remove Suspense boundaries according to the granularity of your visual UI design and without worrying which components exactly might depend on asynchronous code and data.
73+
In JavaScript, when you `throw`, the closest `catch` above "wins", even if it's several function calls higher. Although Suspense works differently under the hood, the mental model is similar: if a component suspends, the closest `Suspense` component above the suspending component "catches" it, no matter how many components that are in between. In the above example, if `ProfileHeader` suspends, then the entire page will be replaced with the `PageGlimmer`. However, if either `Comments` or `Photos` suspend, they together will be replaced with the `LeftColumnGlimmer`. This lets you safely add and remove Suspense boundaries according to the granularity of your visual UI design and without worrying which components exactly might depend on asynchronous code and data.
7474

7575
The exact mechanism of an arbitrary component "suspending" is out of scope of this RFC. The built-in `React.lazy` component suspends automatically if the code associated with the import has not yet loaded, and tells React to retry rendering when the code has loaded. We expect to add an API for an arbitrary component to suspend in a future RFC. Regardless of how the details of that API, for the purposes of this RFC, we can assume that any component might want to suspend and provide React with a Promise. React will *not* use the result of this Promise, but it will retry rendering. This can result in a completed render, an error, or getting suspended again (and displaying the fallback).
7676

0 commit comments

Comments
 (0)