Skip to content

Commit b1fdae5

Browse files
committed
fix: Add missing dependencies to dependency-array for hooks
1 parent 2afd52a commit b1fdae5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/useIsVisible.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ function useIsVisible(nodeRef) {
99
setVisible(isIntersecting)
1010
}
1111

12-
useEffect(() => VO.watch(nodeRef.current, handleVisibilityChange), [])
12+
useEffect(() => VO.watch(nodeRef.current, handleVisibilityChange), [
13+
nodeRef,
14+
handleVisibilityChange,
15+
])
1316

1417
return isVisible
1518
}

0 commit comments

Comments
 (0)