0.0.2 • Published 4 years ago

use-is-scrolled v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

A react hook to detect whether a user has already scrolled on a page or entered a page at a lower section.

I needed a way of detecting whether the user has scrolled. The main idea of how this hook is built was taken from this livestream (starting at about 46:00) done by Max Stoiber.

Usage

Using npm:

  npm install use-is-scrolled

Using yarn:

  yarn add use-is-scrolled

After installation, in your react component:

  import useIsScrolled from "use-is-scrolled"

  // from within your react component and receive true or false
  const isScrolled = useIsScrolled();