chore: prefer React.use instead of throwing promises [WIP]#10012
chore: prefer React.use instead of throwing promises [WIP]#10012juliusmarminge wants to merge 6 commits intomainfrom
React.use instead of throwing promises [WIP]#10012Conversation
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
React.use instead of throwing promisesReact.use instead of throwing promises [WIP]
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx affected --targets=test:sherif,test:knip,tes... |
❌ Failed | 2m 37s | View ↗ |
nx run-many --target=build --exclude=examples/*... |
✅ Succeeded | 1s | View ↗ |
☁️ Nx Cloud last updated this comment at 2026-01-02 20:48:00 UTC
size-limit report 📦
|
| observer, | ||
| errorResetBoundary, | ||
| ) | ||
| suspend(promise.finally(() => observer.updateResult())) |
There was a problem hiding this comment.
why isn’t this just suspend(promise) ? also, do we need to return after that ? I think throw usually stops execution of the rest?
4289738 to
cc7a99f
Compare

🎯 Changes
Migrate to use
React.usewhen available instead of throwing promises. This adds support for thesuspended bystate in the React Devtools:Before
After
<add screenshot>Ref: https://discord.com/channels/719702312431386674/1446346759776370772
✅ Checklist
pnpm run test:pr.🚀 Release Impact