[DevTools] Always attempt to mount dehydrated roots (#34209)
Sebastian "Sebbie" Silbermann committed
Aug 16, 2025 at 10:45 UTC
546bac728125bed821c0205e3d7216a7c9a563cb
2 files changed
+4
-9
packages/react-devtools-shared/src/backend/fiber/renderer.js
+2
-7
@@ -5278,14 +5278,9 @@ export function attach(
5278
// TODO: relying on this seems a bit fishy.
5279
const wasMounted =
5280
prevFiber.memoizedState != null &&
5281
- prevFiber.memoizedState.element != null &&
5282
- // A dehydrated root is not considered mounted
5283
- prevFiber.memoizedState.isDehydrated !== true;
5281
+ prevFiber.memoizedState.element != null;
5282
const isMounted =
5285
- current.memoizedState != null &&
5286
- current.memoizedState.element != null &&
5287
- // A dehydrated root is not considered mounted
5288
- current.memoizedState.isDehydrated !== true;
5283
+ current.memoizedState != null && current.memoizedState.element != null;
5284
if (!wasMounted && isMounted) {
5285
// Mount a new root.
5286
setRootPseudoKey(currentRoot.id, current);
packages/react-devtools-shared/src/utils.js
+2
-2
@@ -300,7 +300,7 @@ export function printOperationsArray(operations: Array<number>) {
300
}
301
case TREE_OPERATION_SET_SUBTREE_MODE: {
302
const id = operations[i + 1];
303
- const mode = operations[i + 1];
303
+ const mode = operations[i + 2];
304
305
i += 3;
306
@@ -339,11 +339,11 @@ export function printOperationsArray(operations: Array<number>) {
339
const fiberID = operations[i + 1];
340
const parentID = operations[i + 2];
341
const nameStringID = operations[i + 3];
342
- const name = stringTable[nameStringID];
342
const numRects = operations[i + 4];
343
344
i += 5;
345
346
+ const name = stringTable[nameStringID];
347
let rects: string;
348
if (numRects === -1) {
349
rects = 'null';