Skip to content

Commit 2a93bf0

Browse files
committed
disconnect on tear down
1 parent 42530e1 commit 2a93bf0

File tree

1 file changed

+1
-1
lines changed
  • src/components/sidebarTableOfContents

1 file changed

+1
-1
lines changed

src/components/sidebarTableOfContents/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export function SidebarTableOfContents() {
184184
}, observerOptions);
185185
const headings = tocItems.map(item => item.element);
186186
headings.forEach(heading => observer.observe(heading));
187-
return () => headings.forEach(heading => observer.unobserve(heading));
187+
return () => observer.disconnect();
188188
}, [tocItems]);
189189

190190
return (

0 commit comments

Comments
 (0)