how to detect user scrolling to the top in react js code example Example: check scroll top height in react js console.log(window.pageYOffset)