Skip to content

Commit

Permalink
fix: consider alternate as a key for componentLogsEntry when inspecti…
Browse files Browse the repository at this point in the history
…ng raw fiber instance
  • Loading branch information
hoxyq committed Sep 20, 2024
1 parent e495392 commit a1cdb5b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react-devtools-shared/src/backend/fiber/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4248,7 +4248,10 @@ export function attach(
source = getSourceForFiberInstance(fiberInstance);
}

const componentLogsEntry = fiberToComponentLogsMap.get(fiber);
let componentLogsEntry = fiberToComponentLogsMap.get(fiber);
if (componentLogsEntry === undefined && fiber.alternate !== null) {
componentLogsEntry = fiberToComponentLogsMap.get(fiber.alternate);
}

return {
id: fiberInstance.id,
Expand Down

0 comments on commit a1cdb5b

Please sign in to comment.