use-scroll-direction
Detects whether the user is scrolling up or down
Source
Docs
Package
Usage
The use-scroll-direction hook detects whether the user is currently scrolling up or down.
It returns 'up' when the user is scrolling up, 'down' when scrolling down, and 'unknown'
before any scroll event has occurred.
Scroll to detect direction
Scroll the page to see the scroll direction