Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
y: pageY - rect.top - window.pageYOffset,
pageX,
pageY,
clientX,
clientY,
screenX,
screenY,
elementWidth: rect.width,
elementHeight: rect.height,
isOver: true
})
},
emptyArr
)
const onMove = useThrottleCallback(_onMove, fps, true)
const onEnter = useCallback(
e => delay(
enterDelay,
() => {
entered.current = true
onMove(e)
}
),
[enterDelay, delay]
)
const onLeave = useCallback(
() => delay(
leaveDelay,
() => {
entered.current = false
pageX,
pageY,
clientX,
clientY,
screenX,
screenY,
elementWidth: rect.width,
elementHeight: rect.height,
isOver: true,
isDown: prev.isDown,
}))
},
[element]
)
const onMove = useThrottleCallback(onMove_, fps, true)
useEffect((): void | (() => void) => {
if (element !== null) {
const onEnter = (e: MouseEvent): void => {
delay(enterDelay, (): void => {
entered.current = true
onMove(e)
})
}
const onLeave = (): void => {
delay(leaveDelay, (): void => {
entered.current = false
setState(initialState)
})
}
const onDown = (): void => {