JamesBrill/react-speech-recognition

useSpeechRecognition() Error

svshiv opened this issue · 1 comments

svshiv commented

I am getting error while using at useSpeechRecognition() function.
Here is my error:

Uncaught TypeError: Cannot read properties of null (reading 'useState') at useState (react.development.js:1622:1) at useSpeechRecognition (SpeechRecognition.js:65:1) at App (App.js:11:1) at renderWithHooks (react-dom.development.js:16305:1) at mountIndeterminateComponent (react-dom.development.js:20074:1) at beginWork (react-dom.development.js:21587:1) at beginWork$1 (react-dom.development.js:27426:1) at performUnitOfWork (react-dom.development.js:26557:1) at workLoopSync (react-dom.development.js:26466:1) at renderRootSync (react-dom.development.js:26434:1)

Here is my code:

`
import React from 'react';
import { useSpeechRecognition } from 'react-speech-recognition';

const App = () => {
const {
transcript,
listening,
resetTranscript,
browserSupportsSpeechRecognition
} = useSpeechRecognition();

return (


Hey I am being ready to listen

)
}

export default App
`

Please Help.

It is difficult to help with more details about your environment. Can you specify versions and what do you use to render react? Like create react app or nextjs...