Skip to content

Commit

Permalink
add remove child
Browse files Browse the repository at this point in the history
Signed-off-by: tygao <[email protected]>
  • Loading branch information
raintygao committed Jun 6, 2024
1 parent 204ac9d commit 632adbf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion public/hooks/use_patch_fixed_style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ export const usePatchFixedStyle = () => {
});
return () => {
subscription.unsubscribe();
document.head.removeChild(style);
if (textRef.current) {
style.removeChild(textRef.current);
}
};
}, []);
}, [sidecarConfig$]);
};

function updateHeadStyle(config: ISidecarConfig, text?: Text) {
Expand Down

0 comments on commit 632adbf

Please sign in to comment.