Answer the question
In order to leave comments, you need to log in
How to write scroll tracking for a component in ReactJS?
I want to set css animation of soft appearance when scrolling.
how to set wiretapping scroll?
Answer the question
In order to leave comments, you need to log in
As I understand it, the problem is precisely that it is necessary to listen to the scroll not of window, but of a specific block?
Then:
1. We get a link to a specific react element - https://reactjs.org/docs/refs-and-the-dom.html
2. Then you can simply listen to the scroll event through native js - https://learn.javascript. en/size-and-scroll
Just don't forget to remove the listener when you unmount the component.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question