Skip to content

Commit 7fc888d

Browse files
authored
[DevTools] Stop recording reorders in disconnected subtrees (facebook#34464)
1 parent 67415c8 commit 7fc888d

File tree

1 file changed

+6
-2
lines changed
  • packages/react-devtools-shared/src/backend/fiber

1 file changed

+6
-2
lines changed

packages/react-devtools-shared/src/backend/fiber/renderer.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4310,7 +4310,9 @@ export function attach(
43104310
virtualLevel + 1,
43114311
);
43124312
if ((updateFlags & ShouldResetChildren) !== NoUpdate) {
4313-
recordResetChildren(virtualInstance);
4313+
if (!isInDisconnectedSubtree) {
4314+
recordResetChildren(virtualInstance);
4315+
}
43144316
updateFlags &= ~ShouldResetChildren;
43154317
}
43164318
removePreviousSuspendedBy(
@@ -5097,7 +5099,9 @@ export function attach(
50975099
// We need to crawl the subtree for closest non-filtered Fibers
50985100
// so that we can display them in a flat children set.
50995101
if (fiberInstance !== null && fiberInstance.kind === FIBER_INSTANCE) {
5100-
recordResetChildren(fiberInstance);
5102+
if (!nextIsHidden && !isInDisconnectedSubtree) {
5103+
recordResetChildren(fiberInstance);
5104+
}
51015105
51025106
// We've handled the child order change for this Fiber.
51035107
// Since it's included, there's no need to invalidate parent child order.

0 commit comments

Comments
 (0)