Custom React Hook to get vertical scroll position
npm install react-use-scroll

A custom React Hook to get the vertical scroll of the window.
Useful for conditionally rendering elements at fixed scroll points like Sticky Menus or Notifications.
$ npm install react-use-scroll
``js
import useScroll from 'react-use-scroll';
const scroll = useScroll();
console.log(scroll); //Stateful scroll value i.e. 0
`
Another example
`js
import useScroll from 'react-use-scroll';
const App = props => {
const scroll = useScroll();
return (
{scroll === 0 &&
This welcome message or banner disappears once the user scrolls down.
} {/ //Rest of the page /}
MIT