Skip to content

Commit 44329e7

Browse files
committed
refactor: Unsubscribe
1 parent 9cffe1e commit 44329e7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/components/chart-published.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,11 @@ export const ChartPublishedInner = ({
126126
}, [metadataPanelOpen]);
127127

128128
useEffect(() => {
129-
metadataPanelStore.subscribe(() => {
129+
const unsubscribe = metadataPanelStore.subscribe(() => {
130130
computeContainerHeight();
131131
});
132+
133+
return () => unsubscribe();
132134
});
133135

134136
const classes = useStyles({

0 commit comments

Comments
 (0)