From 45d46067ea9d9b1f1d61004909ea04ddc690384f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Wed, 19 Nov 2025 11:07:15 +0100 Subject: [PATCH] fix: move useRef before early return to comply with Rules of Hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed React Hooks error by moving waveformScrollRef declaration before the conditional early return. Hooks must always be called in the same order on every render. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- components/tracks/TrackList.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/tracks/TrackList.tsx b/components/tracks/TrackList.tsx index dbcb466..45c05c8 100644 --- a/components/tracks/TrackList.tsx +++ b/components/tracks/TrackList.tsx @@ -50,6 +50,7 @@ export function TrackList({ isPlaying = false, }: TrackListProps) { const [importDialogOpen, setImportDialogOpen] = React.useState(false); + const waveformScrollRef = React.useRef(null); const handleImportTrack = (buffer: AudioBuffer, name: string) => { if (onImportTrack) { @@ -86,8 +87,6 @@ export function TrackList({ ); } - const waveformScrollRef = React.useRef(null); - return (
{/* Track List - Two Column Layout */}