chore: fix cleanup function

This commit is contained in:
Aman Harwara
2023-02-08 18:23:14 +05:30
parent cf975cfed3
commit e794b873a5

View File

@@ -46,7 +46,7 @@ export const useLongPressEvent = (
}
elementRef.current.removeEventListener('pointerdown', createLongPressTimeout)
elementRef.current.addEventListener('pointermove', clearLongPressTimeout)
elementRef.current.removeEventListener('pointermove', clearLongPressTimeout)
elementRef.current.removeEventListener('pointercancel', clearLongPressTimeout)
elementRef.current.removeEventListener('pointerup', clearLongPressTimeout)
}, [clearLongPressTimeout, createLongPressTimeout, elementRef])