Skip to content

Commit a8fbacd

Browse files
Ensure useIntersectionObserver hook only reruns on target.current updates (TanStack#406)
1 parent 24bac23 commit a8fbacd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/load-more-infinite-scroll/hooks/useIntersectionObserver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ export default function useIntersectionObserver({
2525
return () => {
2626
observer.unobserve(el)
2727
}
28-
})
28+
}, [target.current])
2929
}

0 commit comments

Comments
 (0)