From c0cfa40c07ef7c9f73be74ce77a9121f2f0fbd39 Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Tue, 8 Oct 2024 14:10:06 +0200 Subject: [PATCH] add null check to resize observer disconnect call --- src/hooks/useResizeObserver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useResizeObserver.ts b/src/hooks/useResizeObserver.ts index bd194300..574eb6cf 100644 --- a/src/hooks/useResizeObserver.ts +++ b/src/hooks/useResizeObserver.ts @@ -33,7 +33,7 @@ const useResizeObserver = ( RO.observe(ref.current) return () => { - RO.disconnect() + RO?.disconnect() RO = null } }, [ref, handleResize])