Skip to content

Commit c7d6b70

Browse files
authored
Add conditional use warning deeplink (#8567)
1 parent 9e97ad0 commit c7d6b70

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/content/reference/react/use.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ 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. {/*conditional-use*/}
666666
667667
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.
668668

vercel.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@
174174
"destination": "/warnings/invalid-hook-call-warning#mismatching-versions-of-react-and-react-dom",
175175
"permanent": false
176176
},
177+
{
178+
"source": "/warnings/conditional-use-of-use",
179+
"destination": "/reference/react/use#conditional-use",
180+
"permanent": false
181+
},
177182
{
178183
"source": "/reference/react/directives",
179184
"destination": "/reference/rsc/directives",

0 commit comments

Comments
 (0)