Skip to content

Commit

Permalink
chore: swipe 훅 안의 함수 const형으로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
wokbjso committed Oct 14, 2024
1 parent fec5eac commit f574204
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hooks/use-swipe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export function useSwipe({
}: UseSwipeProps) {
const [touchStartX, setTouchStartX] = useState<number | null>(null);

function handleTouchStart(e: React.TouchEvent<HTMLDivElement>) {
const handleTouchStart = (e: React.TouchEvent<HTMLDivElement>) => {
setTouchStartX(e.touches[0].clientX);
}
};

function handleTouchEnd(e: React.TouchEvent<HTMLDivElement>) {
const handleTouchEnd = (e: React.TouchEvent<HTMLDivElement>) => {
if (touchStartX === null) return;

const touchEndX = e.changedTouches[0].clientX;
Expand All @@ -34,7 +34,7 @@ export function useSwipe({
}

setTouchStartX(null);
}
};

return {
handleTouchStart,
Expand Down

0 comments on commit f574204

Please sign in to comment.