-
-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Description
I am using react-speech-recognition like this -
const { transcript, listening, resetTranscript } = useSpeechRecognition();
useEffect(() => {
if (transcript) {
dispatch(setPrompt(transcript));
}
}, [transcript, dispatch]);
<Textarea value={prompt}
onKeyDown={(e) => {
if (e.key === "Enter" && !e.shiftKey) {
e.preventDefault();
if (listening) {
SpeechRecognition.abortListening();
resetTranscript();
}
handleGenerateClick();
setTimeout(() => {
resetTranscript();
dispatch(setPrompt(""));
}, 200);
}
}} />
The issue I am facing is, resetTranscript() is not working properly on Chrome. After abort also, whenever I come back to this component, due to useEffect the transcript is remaining in the instance.
Can you please help me out!
The version I am using is - 4.0.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels