From 8e3791fb375dcd495fdb07ae3d9b30af7d4f33f0 Mon Sep 17 00:00:00 2001 From: tkrmagid Date: Sun, 13 Sep 2026 01:59:25 +0900 Subject: [PATCH] =?UTF-8?q?fix(page):=20PlayerBar=20useRef=20=EC=B4=88?= =?UTF-8?q?=EA=B8=B0=EA=B0=92=EC=9D=98=20Date.now()=20purity=20lint=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC=20=ED=95=B4=EC=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit react-hooks/purity 가 useRef 초기화의 Date.now() 호출을 에러로 잡는데, 초기값은 최초 렌더 1회만 평가되어 안전하므로 해당 라인만 eslint-disable 처리. 동작 변경 없음. npm run lint 0 errors. --- page/src/components/player/PlayerBar.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/page/src/components/player/PlayerBar.tsx b/page/src/components/player/PlayerBar.tsx index 99f3cdd..fdec872 100644 --- a/page/src/components/player/PlayerBar.tsx +++ b/page/src/components/player/PlayerBar.tsx @@ -23,6 +23,8 @@ export default function PlayerBar({ selectedServer }: PlayerBarProps) { const [duration, setDuration] = useState(0); const isDragging = useRef(false); // 재생바를 드래그 중인지 여부 // 진행바 계산 기준점: 이 시점(at)에 위치가 pos였다 → 현재위치 = pos + (now - at) + // useRef 초기값은 최초 렌더 1회만 평가되므로 Date.now() 호출이 안전(리렌더마다 재실행 안 됨). + // eslint-disable-next-line react-hooks/purity const anchorRef = useRef<{ pos: number; at: number }>({ pos: 0, at: Date.now() }); const prevVolumeRef = useRef(50); // 드래그 시작 시점 볼륨(실패 시 롤백용) // 👇 [추가할 부분] 볼륨 바를 잡고 있는지 여부 추적