Skip to content

Commit 0211984

Browse files
authored
close intersection observer on dismount (github#26292)
1 parent 4173044 commit 0211984

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

components/article/ClientSideHighlightJS.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ export default function ClientSideHighlightJS() {
6666
intersectionObserver.observe(element)
6767
}
6868
}
69+
70+
return () => {
71+
intersectionObserver.disconnect()
72+
}
6973
}, [asPath])
7074

7175
return null

0 commit comments

Comments
 (0)