Skip to content

Commit d18c73a

Browse files
authored
Update guidance on using the use hook with Promises
Clarify usage of `use` hook regarding Promise handling.
1 parent 500dbba commit d18c73a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • src/content/reference/react

src/content/reference/react/use.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,8 @@ This cache pattern is the foundation for [re-fetching data](#re-fetching-data-in
662662
663663
<Pitfall>
664664
665-
Don't skip calling `use` based on whether a Promise is already settled.
665+
Don't skip calling `use` based on whether a Promise is already settled.
666+
666667
Unlike other hooks, `use` can be called inside conditions and loops — but it must always be called for the Promise itself. Never read `promise.status` or `promise.value` directly to bypass `use`; always pass the Promise to `use` and let React handle it.
667668
668669

0 commit comments

Comments
 (0)