how to get y postion in react sroll code example Example: check scroll top height in react js console.log(window.pageYOffset)