startListening is not a function
vahidvdn opened this issue · 2 comments
vahidvdn commented
Hi, This is how I want to use startListening
:
<button onClick={() => SpeechRecognition.startListening()}>Start</button>
I get the following error:
Uncaught TypeError: import_react_speech_recognition.default.startListening is not a function
But when I use this one it works fine:
SpeechRecognition.default.startListening()
I don't know why I need to use the default
keyword there. It seems weird. Btw, now typescript is complaining about using the default
keyword. Any idea?
Note: stopListening
works fine