Skip to content

Commit da9d092

Browse files
committed
main 🧊 fix use effect for untersection observer
1 parent 950d580 commit da9d092

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/hooks/useIntersectionObserver/useIntersectionObserver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export const useIntersectionObserver = ((...params: any[]) => {
7474
internalOnChangeRef.current = options?.onChange;
7575

7676
useEffect(() => {
77-
if (!enabled || !internalRef) return;
77+
if (!enabled && !target && !internalRef) return;
7878
const element = target ? getElement(target) : internalRef;
7979
if (!element) return;
8080

0 commit comments

Comments
 (0)