JamesBrill / react-speech-recognition

💬Speech recognition for your React app
https://webspeechrecognition.com/
MIT License
637 stars 116 forks source link

startListening is not a function #206

Open vahidvdn opened 2 months ago

vahidvdn commented 2 months ago

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