Skip to content

Fix useDeferredValue getting stuck#36134

Merged
gaearon merged 3 commits intomainfrom
fix-udv-stall
Mar 24, 2026
Merged

Fix useDeferredValue getting stuck#36134
gaearon merged 3 commits intomainfrom
fix-udv-stall

Conversation

@gaearon
Copy link
Collaborator

@gaearon gaearon commented Mar 24, 2026

Fixes #35821

Written/debugged by Claude.

Test Plan

@meta-cla meta-cla bot added the CLA Signed label Mar 24, 2026
@gaearon gaearon requested a review from acdlite March 24, 2026 00:41
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Mar 24, 2026
@react-sizebot
Copy link

Comparing: ed69815...df5ef86

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB = 1.88 kB 1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js +0.01% 612.81 kB 612.88 kB = 108.29 kB 108.30 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.84 kB 6.84 kB = 1.88 kB 1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 678.75 kB 678.81 kB = 119.25 kB 119.26 kB
facebook-www/ReactDOM-prod.classic.js = 698.14 kB 698.20 kB = 122.65 kB 122.65 kB
facebook-www/ReactDOM-prod.modern.js = 688.45 kB 688.52 kB = 121.02 kB 121.03 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against df5ef86

Copy link
Collaborator

@acdlite acdlite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Is it a good or a bad thing that there was already a TODO that (sorta) described the issue 😆

Discussed out-of-band, writing here for posterity:

The TODO I think is still correct, we should generalize that special-error-to-unwind-the-stack trick thing that we use for selective hydration. The main benefit is that if you're mid render it can restart immediately instead of burning cycles on a work-in-progress render that will inevitably get thrown out regardless. Leaving for a future PR in case we were to accidentally introduce a new bug in the progress.

@gaearon gaearon merged commit c0d218f into main Mar 24, 2026
245 checks passed
@gaearon gaearon deleted the fix-udv-stall branch March 24, 2026 00:49
github-actions bot pushed a commit that referenced this pull request Mar 24, 2026
Fixes #35821

Written/debugged by Claude.

## Test Plan

- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro

DiffTrain build for [c0d218f](c0d218f)
github-actions bot pushed a commit that referenced this pull request Mar 24, 2026
Fixes #35821

Written/debugged by Claude.

## Test Plan

- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro

DiffTrain build for [c0d218f](c0d218f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: useDeferredValue gets stuck with a stale value

3 participants