Skip to content

Commit 731b9b6

Browse files
committed
[DevTools] Fix memory leak when unmounting hoistables
1 parent e4c4587 commit 731b9b6

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/react-devtools-shared/src/__tests__/store-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3668,6 +3668,6 @@ describe('Store', () => {
36683668
`);
36693669
style = document.head.querySelector('style');
36703670
styleID = agent.getIDForHostInstance(style).id;
3671-
expect(store.containsElement(styleID)).toBe(false);
3671+
expect(store.containsElement(styleID)).toBe(true);
36723672
});
36733673
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,8 +991,8 @@ function releaseHostResource(
991991
// eslint-disable-next-line no-for-of-loops/no-for-of-loops
992992
for (const firstInstance of resourceInstances) {
993993
publicInstanceToDevToolsInstanceMap.set(
994+
publicInstance,
994995
firstInstance,
995-
nearestInstance,
996996
);
997997
break;
998998
}

0 commit comments

Comments
 (0)