To determine the scrolling (up / down) I use the function that hangs on the 'scroll' event.
scrollUpDown() {
if (this.state.lastScrollPos < getScrollTop() ) {
this.setState({lastScrollPos: getScrollTop()});
console.log('down')
}
else if (this.state.lastScrollPos > getScrollTop() ) {
this.setState({lastScrollPos: getScrollTop()});
console.log('up')
}
}
How can I check scrolling without using the work with state?