[DevTools] Stop recording reorders in disconnected subtrees (#34464)
Sebastian "Sebbie" Silbermann committed
Sep 11, 2025 at 19:13 UTC
7fc888dde29b4696252a8a0c570952987eca7e46
1 file changed
+6
-2
packages/react-devtools-shared/src/backend/fiber/renderer.js
+6
-2
@@ -4310,7 +4310,9 @@ export function attach(
4310
virtualLevel + 1,
4311
);
4312
if ((updateFlags & ShouldResetChildren) !== NoUpdate) {
4313
- recordResetChildren(virtualInstance);
4313
+ if (!isInDisconnectedSubtree) {
4314
+ recordResetChildren(virtualInstance);
4315
+ }
4316
updateFlags &= ~ShouldResetChildren;
4317
}
4318
removePreviousSuspendedBy(
@@ -5097,7 +5099,9 @@ export function attach(
5099
// We need to crawl the subtree for closest non-filtered Fibers
5100
// so that we can display them in a flat children set.
5101
if (fiberInstance !== null && fiberInstance.kind === FIBER_INSTANCE) {
5100
- recordResetChildren(fiberInstance);
5102
+ if (!nextIsHidden && !isInDisconnectedSubtree) {
5103
+ recordResetChildren(fiberInstance);
5104
+ }
5105
5106
// We've handled the child order change for this Fiber.
5107
// Since it's included, there's no need to invalidate parent child order.