Skip to content

Commit

Permalink
fix: useIntersectionObserver (juliencrn#195 from @Guesswhoitis)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliencrn committed Oct 13, 2022
1 parent d5cec01 commit e21e515
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/useIntersectionObserver/useIntersectionObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit e21e515

Please sign in to comment.