JamesBrill / react-speech-recognition

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

Reset transcript in command callback #54

Closed JamesBrill closed 4 years ago

JamesBrill commented 4 years ago

Command callbacks do not have access to the resetTranscript function as they have to be defined before resetTranscript is returned by useSpeechRecognition. This PR addresses this problem by passing resetTranscript to the command callbacks as the last argument. This is put inside an object to allow further properties to be passed in future. Intended to address https://github.com/JamesBrill/react-speech-recognition/issues/53