Closed ClementJanssens closed 3 years ago
Sorry for the horribly slow response.
If you don't pass the ref to an element, it will still behave as a document bottom scroll listener. If you still have this issue, can you show me how you are setting the ref?
If you are passing the ref to a React component, you will have to use React.forwardRef to forward the ref to an actual DOM-node.
Hi,
I'm closing this. But feel free to re-open it if you need.
I'm trying to set up a listener on specific container but callback func is called even if I scroll to bottom of body : behaviour of scrolling to bottom of body.
const containerRef = useBottomScrollListener(handleContainerOnBottom);
This line creates a body listener even I link JSX Element with reference