From e21e5159e6b49c1d792a003b4d5e823ca7c11dc2 Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 13 Oct 2022 02:06:16 +0200 Subject: [PATCH] fix: useIntersectionObserver (#195 from @Guesswhoitis) --- src/useIntersectionObserver/useIntersectionObserver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/useIntersectionObserver/useIntersectionObserver.ts b/src/useIntersectionObserver/useIntersectionObserver.ts index 92a5a676..807691cd 100644 --- a/src/useIntersectionObserver/useIntersectionObserver.ts +++ b/src/useIntersectionObserver/useIntersectionObserver.ts @@ -35,7 +35,7 @@ function useIntersectionObserver( return () => observer.disconnect() // eslint-disable-next-line react-hooks/exhaustive-deps - }, [elementRef, JSON.stringify(threshold), root, rootMargin, frozen]) + }, [elementRef?.current, JSON.stringify(threshold), root, rootMargin, frozen]) return entry }