Skip to content

Conversation

eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Sep 16, 2025

Stacked on #34495
Follow-up to #34467

We can't reference a Fiber instance that we never fully mounted since we use these Fiber root instances to get the previous Fiber to reconcile against.

Fixes "There should always be an Offscreen Fiber child in a hydrated Suspense boundary." due to attempting to unmount a Fiber that we didn't actually mount and "There should always be a SuspenseNode parent on a mounted instance." because we attempted to update a Fiber instance that never actually went through mountFiberRecursively because it didn't have any child when we first encountered it.

@meta-cla meta-cla bot added the CLA Signed label Sep 16, 2025
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Sep 16, 2025
unmountInstanceRecursively(rootInstance);
rootToFiberInstanceMap.delete(root);
flushPendingEvents(root);
flushPendingEvents();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

drive-by fix. flushPendingEvents doesn't actually use any of its arguments.

@eps1lon eps1lon changed the title [DevTools] Don't keep stale root instances around we never mounted [DevTools] Don't keep stale root instances we never mounted around Sep 16, 2025
@eps1lon eps1lon marked this pull request as ready for review September 16, 2025 13:53
@eps1lon eps1lon requested a review from sebmarkbage September 16, 2025 14:41
@eps1lon eps1lon force-pushed the sebbie/09-16-_devtools_use_alternate_as_previous_fiber_when_reconciling_root branch from c8833ff to a387a3f Compare September 16, 2025 16:58
@eps1lon eps1lon merged commit 941cd80 into facebook:main Sep 16, 2025
241 checks passed
@eps1lon eps1lon deleted the sebbie/09-16-_devtools_use_alternate_as_previous_fiber_when_reconciling_root branch September 16, 2025 17:17
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.

2 participants