Skip to content

Commit fa836d7

Browse files
authored
Update README.md (#6)
WHen using TypeScript I couldn't get my containerRef to work as it was not of the expected format `RefObject<HTMLElement>`. I RefObject expected either HTMLElement or null: ```ts interface RefObject<T> { /** * The current value of the ref. */ readonly current: T | null; } ``` Calling useRef without initial arguments creates the ref as `MutableRefObject<T | undefined>` which is incompatible.
1 parent 03db34d commit fa836d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ import { useRef } from 'react'
6666
import { useWavesurfer } from '@wavesurfer/react'
6767

6868
const App = () => {
69-
const containerRef = useRef()
69+
const containerRef = useRef(null)
7070

7171
const { wavesurfer, isReady, isPlaying, currentTime } = useWavesurfer({
7272
container: containerRef,

0 commit comments

Comments
 (0)