From 6e1cfba3b2ec566016ce06fc408d69839cfef004 Mon Sep 17 00:00:00 2001 From: Zane Helton Date: Mon, 20 Jan 2025 13:46:11 -0500 Subject: [PATCH] fix: add initial values to useRefs --- src/components/Keyboard/Keyboard.tsx | 2 +- src/components/Quiz/Quiz.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Keyboard/Keyboard.tsx b/src/components/Keyboard/Keyboard.tsx index 191bd50..6fb25dc 100644 --- a/src/components/Keyboard/Keyboard.tsx +++ b/src/components/Keyboard/Keyboard.tsx @@ -38,7 +38,7 @@ const Keyboard = () => { const { muteSound, showKeyboard, midiDevice, setMidiDevice, pianoSound } = useContext(KVContext) - const unlistenRef = useRef() + const unlistenRef = useRef(null) const [activeNotes, setActiveNotes] = useState<{ [note: string]: boolean }>( {} ) diff --git a/src/components/Quiz/Quiz.tsx b/src/components/Quiz/Quiz.tsx index a1f1e9f..6487e1f 100644 --- a/src/components/Quiz/Quiz.tsx +++ b/src/components/Quiz/Quiz.tsx @@ -62,7 +62,7 @@ const KeyboardContainer = styled.div` const Quiz = () => { const { showKeyboard, midiDevice, setMidiDevice } = useContext(KVContext) const { chordStack, setChordStack } = useContext(TrainerContext) - const unlistenRef = useRef() + const unlistenRef = useRef(null) const [activeNotes, setActiveNotes] = useState<{ [note: string]: boolean }>( {} )