Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/content/reference/react/use.md
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ This cache pattern is the foundation for [re-fetching data](#re-fetching-data-in

<Pitfall>

Don't skip calling `use` based on whether a Promise is already settled.
##### Don't skip calling `use` based on whether a Promise is already settled. {/*conditional-use*/}

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.

Expand Down
5 changes: 5 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@
"destination": "/warnings/invalid-hook-call-warning#mismatching-versions-of-react-and-react-dom",
"permanent": false
},
{
"source": "/warnings/conditional-use-of-use",
"destination": "/reference/react/use#conditional-use",
"permanent": false
},
{
"source": "/reference/react/directives",
"destination": "/reference/rsc/directives",
Expand Down
Loading