1.0.6 • Published 5 years ago

@vtexlab/window-scroll-position v1.0.6

Weekly downloads
32
License
MIT
Repository
github
Last release
5 years ago

@rehooks/window-scroll-position

This is a fix for the library for exito.com. It changes let to var to support older browsers.

React hook for Window scroll position

Note: This is using the new React Hooks API Proposal which is subject to change until React 16.7 final.

You'll need to install react, react-dom, etc at ^16.7.0-alpha.0

Install

yarn add @rehooks/window-scroll-position

Usage

import useWindowScrollPosition from '@rehooks/window-scroll-position'

function MyComponent() {
  // optionally you can pass options, those are default:
  let options = {
    throttle: 100,
  }
  let position = useWindowScrollPosition(options)
  // position == { x: 0, y: 0 }
  return <div />
}
1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago