Skip to content

Commit a5b2ad4

Browse files
committed
fix: consider alternate as a key for componentLogsEntry when inspecting raw fiber instance
1 parent e495392 commit a5b2ad4

File tree

1 file changed

+8
-1
lines changed
  • packages/react-devtools-shared/src/backend/fiber

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,10 @@ export function attach(
10291029
if (devtoolsInstance.kind === FIBER_INSTANCE) {
10301030
const fiber = devtoolsInstance.data;
10311031
componentLogsEntry = fiberToComponentLogsMap.get(fiber);
1032+
1033+
if (componentLogsEntry === undefined && fiber.alternate !== null) {
1034+
componentLogsEntry = fiberToComponentLogsMap.get(fiber.alternate);
1035+
}
10321036
} else {
10331037
const componentInfo = devtoolsInstance.data;
10341038
componentLogsEntry = componentInfoToComponentLogsMap.get(componentInfo);
@@ -4248,7 +4252,10 @@ export function attach(
42484252
source = getSourceForFiberInstance(fiberInstance);
42494253
}
42504254

4251-
const componentLogsEntry = fiberToComponentLogsMap.get(fiber);
4255+
let componentLogsEntry = fiberToComponentLogsMap.get(fiber);
4256+
if (componentLogsEntry === undefined && fiber.alternate !== null) {
4257+
componentLogsEntry = fiberToComponentLogsMap.get(fiber.alternate);
4258+
}
42524259

42534260
return {
42544261
id: fiberInstance.id,

0 commit comments

Comments
 (0)