Get information of window scrollbar like current position and direction of last scroll.
import React from 'react'
import { useScrollbar } from 'use-scroll-bar'
function App() {
const scrollState = useScrollbar({ delay: 200 })
retrun (
<div>
User has scrolled {scrollState.directionX}
</div>
)
}
{
directionX: 'left' || 'right',
directionY: 'up' || 'down',
scrollX: number,
scrollY: number
}