diff --git a/hooks/use-swipe.tsx b/hooks/use-swipe.tsx index 70eb3bff..43c67b9b 100644 --- a/hooks/use-swipe.tsx +++ b/hooks/use-swipe.tsx @@ -15,11 +15,11 @@ export function useSwipe({ }: UseSwipeProps) { const [touchStartX, setTouchStartX] = useState(null); - function handleTouchStart(e: React.TouchEvent) { + const handleTouchStart = (e: React.TouchEvent) => { setTouchStartX(e.touches[0].clientX); - } + }; - function handleTouchEnd(e: React.TouchEvent) { + const handleTouchEnd = (e: React.TouchEvent) => { if (touchStartX === null) return; const touchEndX = e.changedTouches[0].clientX; @@ -34,7 +34,7 @@ export function useSwipe({ } setTouchStartX(null); - } + }; return { handleTouchStart,