Skip to content

Commit acecc35

Browse files
authored
fix: Add check for ResizeObserver availability to prevent reference errors (#455)
1 parent 7df9ad7 commit acecc35

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/components/mini-map/use-resize.hook.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ export const useResize = <T extends HTMLElement>(
3737

3838
useLayoutEffect(() => {
3939
didUnmount.current = false;
40+
41+
if (!("ResizeObserver" in window)) {
42+
return;
43+
}
44+
4045
if (ref) {
4146
resizeObserverRef.current = new ResizeObserver(
4247
(entries: ResizeObserverEntry[]) => {

0 commit comments

Comments
 (0)