A React hook that tracks the current scroll position of the window or a specified element.
This hook listens for the scroll event and returns an object with the current
horizontal (x) and vertical (y) scroll positions. It updates automatically whenever the user scrolls.
A React hook that tracks the current scroll position of the window or a specified element.
This hook listens for the scroll event and returns an object with the current horizontal (x) and vertical (y) scroll positions. It updates automatically whenever the user scrolls.
Example
Example