Skip to content

Commit

Permalink
(Mutable)Ref
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Jan 17, 2024
1 parent 5fc0899 commit ad4fe4e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/@uppy/audio/src/RecordingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,8 @@ export default function RecordingScreen(
recordingLengthSeconds,
} = props

const canvasEl = useRef<HTMLCanvasElement>(
null,
) as MutableRef<HTMLCanvasElement>
const oscilloscope = useRef<AudioOscilloscope>(
null,
) as MutableRef<AudioOscilloscope | null>
const canvasEl = useRef<HTMLCanvasElement>(null)
const oscilloscope = useRef<AudioOscilloscope | null>()

// componentDidMount / componentDidUnmount
useEffect(() => {
Expand All @@ -63,7 +59,7 @@ export default function RecordingScreen(
// componentDidUpdate
useEffect(() => {
if (!recordedAudio) {
oscilloscope.current = new AudioOscilloscope(canvasEl.current, {
oscilloscope.current = new AudioOscilloscope(canvasEl.current!, {
canvas: {
width: 600,
height: 600,
Expand Down

0 comments on commit ad4fe4e

Please sign in to comment.