Skip to content

Commit

Permalink
fix: add initial values to useRefs
Browse files Browse the repository at this point in the history
  • Loading branch information
ZaneH committed Jan 20, 2025
1 parent 0415778 commit 6e1cfba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Keyboard/Keyboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Keyboard = () => {

const { muteSound, showKeyboard, midiDevice, setMidiDevice, pianoSound } =
useContext(KVContext)
const unlistenRef = useRef<UnlistenFn>()
const unlistenRef = useRef<UnlistenFn>(null)
const [activeNotes, setActiveNotes] = useState<{ [note: string]: boolean }>(
{}
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/Quiz/Quiz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const KeyboardContainer = styled.div`
const Quiz = () => {
const { showKeyboard, midiDevice, setMidiDevice } = useContext(KVContext)
const { chordStack, setChordStack } = useContext(TrainerContext)
const unlistenRef = useRef<UnlistenFn>()
const unlistenRef = useRef<UnlistenFn>(null)
const [activeNotes, setActiveNotes] = useState<{ [note: string]: boolean }>(
{}
)
Expand Down

0 comments on commit 6e1cfba

Please sign in to comment.