JamesBrill / react-speech-recognition

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

Error: Text strings must be rendered within a <Text> component. #135

Closed cigoic closed 2 years ago

cigoic commented 2 years ago

Hi, I just tried the sample code on README (copy and paste). But got an error as shown below. Any idea to solve this?

Thanks.

Error: Text strings must be rendered within a <Text> component.

This error is located at:
    in span (created by Dictaphone)
    in Dictaphone (created by ExpoRoot)
    in ExpoRoot
    in RCTView (created by View)
    in View (created by AppContainer)
    in DevAppContainer (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
at node_modules/react-native/Libraries/Core/ReactFiberErrorDialog.js:43:2 in showErrorDialog
at node_modules/react-native/Libraries/ReactNative/renderApplication.js:58:4 in renderApplication
at node_modules/react-native/Libraries/ReactNative/AppRegistry.js:117:25 in runnables.appKey.run
at node_modules/react-native/Libraries/ReactNative/AppRegistry.js:202:4 in runApplication

Error: Text strings must be rendered within a <Text> component.

This error is located at:
    in span (created by Dictaphone)
    in Dictaphone (created by ExpoRoot)
    in ExpoRoot
    in RCTView (created by View)
    in View (created by AppContainer)
    in DevAppContainer (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0
JamesBrill commented 2 years ago

Hi @cigoic You appear to be using this library from a React Native app. react-speech-recognition is a web library that is built on top of web APIs and will not function in a native app.

I had a quick Google around and this library may give you what you need: https://github.com/react-native-voice/voice

cigoic commented 2 years ago

wow...Thanks a lot! It's a very helpful repository.

morenoh149 commented 1 year ago

@JamesBrill the react-native-voice project seems to have stalled. Is there any way to use react-speech-recognition within a reactNative app and rely on an internet connect with cloud speech apis?