Skip to content

Commit

Permalink
fix(react-simulator-renderer): detached node has children
Browse files Browse the repository at this point in the history
detached node has children will return false, causing memory leaks.
  • Loading branch information
Zeral-Zhang committed Jan 26, 2024
1 parent b3880e9 commit b29c539
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-simulator-renderer/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ function getNodeInstance(fiberNode: any, specId?: string): IPublicTypeNodeInstan

function checkInstanceMounted(instance: any): boolean {
if (isElement(instance)) {
return instance.parentElement != null;
return instance.parentElement != null && window.document.contains(instance);
}
return true;
}
Expand Down

0 comments on commit b29c539

Please sign in to comment.