Skip to content

Commit 2ae2122

Browse files
committed
[DevTools] Fix memory leak when unmounting hoistables
1 parent 37e918e commit 2ae2122

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
@@ -3669,6 +3669,6 @@ describe('Store', () => {
36693669
`);
36703670
style = document.head.querySelector('style');
36713671
styleID = agent.getIDForHostInstance(style).id;
3672-
expect(store.containsElement(styleID)).toBe(false);
3672+
expect(store.containsElement(styleID)).toBe(true);
36733673
});
36743674
});

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)