Reset throttle timeout after clearing, fixes issue where scroll watcher doesnt fire

This commit is contained in:
Jackson Harper 2023-04-04 22:21:10 +08:00
parent 1220481b00
commit 6f8934fe59

View file

@ -40,6 +40,7 @@ export function useScrollWatcher(effect: Effect, delay: number): void {
return () => {
if (throttleTimeout.current) {
clearTimeout(throttleTimeout.current)
throttleTimeout.current = undefined
}
window.removeEventListener('scroll', handleScroll)
}