Answer the question
In order to leave comments, you need to log in
How to catch the scroll to the desired element in React?
Hey! In a react application, there is a long list of elements on the page. How can I catch the scroll to each element of the list? Let's say the scroll can be listened to like this:
componentDidMount() {
window.addEventListener('scroll', this.handleScroll);
}
Answer the question
In order to leave comments, you need to log in
how to check that scrolled to the next element?Compare the position of the scroll and this element on the page. What is the specific question?
Let's say the scroll can be listened to like this:componentDidMount() { window.addEventListener('scroll', this.handleScroll); }
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question