Skip to content

Commit

Permalink
main 🧊 fix use effect for untersection observer
Browse files Browse the repository at this point in the history
  • Loading branch information
debabin committed Oct 14, 2024
1 parent 950d580 commit da9d092
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const useIntersectionObserver = ((...params: any[]) => {
internalOnChangeRef.current = options?.onChange;

useEffect(() => {
if (!enabled || !internalRef) return;
if (!enabled && !target && !internalRef) return;
const element = target ? getElement(target) : internalRef;
if (!element) return;

Expand Down

0 comments on commit da9d092

Please sign in to comment.