@dh-react-hooks/use-scrollto
reast hooks for scrollTo
Installation
npm i @dh-react-hooks/use-scrollto
Arguments
props | type | required | default | description |
---|---|---|---|---|
x | number | true | undefined | pixel along the horizontal axis of the document |
y | number | true | undefined | pixel along the vertical axis of the document |
Way to Ride
- Common jS
const useScrollto = require('@dh-react-hooks/use-scrollto')
const scrollto = useScrollto.default(x, y)
- ESM
import useScrollto from '@dh-react-hooks/use-scrollto'
const scrollto = useScrollto(x, y)