Skip to content

Commit 92208c2

Browse files
committed
Address additional review feedback
1 parent ceab6da commit 92208c2

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

  • src/content/reference/react

src/content/reference/react/use.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ export async function fetchAlbums() {
438438
439439
##### Promises passed to `use` must be cached {/*promises-must-cached*/}
440440
441-
Promises created inside a component are recreated on every render. This causes React to show the Suspense fallback repeatedly and prevents content from appearing. Instead, pass a Promise from a cache, a Suspense-enabled framework, or a Server Component.
441+
Promises created inside a component are recreated on every render because [React doesn't preserve state for renders that suspended before mounting](/reference/react/Suspense#caveats). After each suspension, React retries rendering from scratch, so any Promise created during render is recreated. This causes React to show the Suspense fallback repeatedly and prevents content from appearing. Instead, pass a Promise from a cache, a Suspense-enabled framework, or a Server Component.
442442
443443
Common ways a Promise can be unintentionally recreated on every render:
444444
@@ -1054,7 +1054,6 @@ root.render(
10541054
10551055
</Sandpack>
10561056
1057-
10581057
<DeepDive>
10591058
10601059
#### Should I resolve a Promise in a Server or Client Component? {/*resolve-promise-in-server-or-client-component*/}
@@ -1213,8 +1212,6 @@ async function getData(url) {
12131212
12141213
---
12151214
1216-
---
1217-
12181215
## Troubleshooting {/*troubleshooting*/}
12191216
12201217
### I'm getting an error: "Suspense Exception: This is not a real error!" {/*suspense-exception-error*/}

0 commit comments

Comments
 (0)