sidevesh/react-native-snackbar-component

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

leonardo2204 opened this issue · 2 comments

Hey @sidevesh, first of all, thanks for the awesome work you've done!
I've just tried the library but I'm getting this exception:

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

This error is located at:
    in RCTView (at createAnimatedComponent.js:151)
    in AnimatedComponent (at react-native-snackbar-component/index.js:46)
    in RCTView (at createAnimatedComponent.js:151)
    in AnimatedComponent (at react-native-snackbar-component/index.js:33)
    in SnackbarComponent (at MainTabNavigation.js:25)
    in RCTView (at MainTabNavigation.js:24)
    in tabBarComponent (at createBottomTabNavigator.js:78)
    in RCTView (at createBottomTabNavigator.js:110)
    in TabNavigationView (at createTabNavigator.js:197)
    in NavigationView (at createNavigator.js:61)
    in Navigator (at createAppContainer.js:429)
    in NavigationContainer (at SceneView.js:9)
    in SceneView (at StackViewLayout.tsx:899)
    in RCTView (at createAnimatedComponent.js:151)
    in AnimatedComponent (at StackViewCard.tsx:93)
    in RCTView (at createAnimatedComponent.js:151)
    in AnimatedComponent (at screens.native.js:59)
    in Screen (at StackViewCard.tsx:80)
    in Card (at createPointerEventsContainer.tsx:95)
    in Container (at StackViewLayout.tsx:971)
    in RCTView (at screens.native.js:83)
    in ScreenContainer (at StackViewLayout.tsx:383)
    in RCTView (at createAnimatedComponent.js:151)
    in AnimatedComponent (at StackViewLayout.tsx:379)
    in PanGestureHandler (at StackViewLayout.tsx:372)
    in StackViewLayout (at withOrientation.js:30)
    in withOrientation (at StackView.tsx:103)
    in RCTView (at Transitioner.tsx:267)
    in Transitioner (at StackView.tsx:40)
    in StackView (at createNavigator.js:61)
    in Navigator (at createKeyboardAwareNavigator.js:12)
    in KeyboardAwareNavigator (at createAppContainer.js:429)
    in NavigationContainer (at RootContainer.js:18)
    in RCTView (at RootContainer.js:16)
    in RootContainer (created by ConnectFunction)
    in ConnectFunction (at App.js:27)
    in PersistGate (at App.js:26)
    in Provider (at App.js:25)
    in App
    in RCTView
    in Unknown (at renderApplication.js:40)
    in RCTView (at AppContainer.js:101)
    in RCTView (at react-native-root-siblings/index.js:33)
    in RootSiblingsWrapper (at AppContainer.js:115)
    in RCTView (at AppContainer.js:119)
    in AppContainer (at renderApplication.js:39)

unstable_runWithPriority
    scheduler.development.js:643:23
Component.prototype.setState
    react.development.js:325:31
NavigationContainer#dispatch
    createAppContainer.js:393:22
actionHelpers.actionName
    getChildNavigation.js:1:1529
checkIfShouldShowOnboarding
    LaunchOnboardingScreen.js:15:37
tryCatch
    runtime.js:45:44
invoke
    runtime.js:271:30
tryCatch
    runtime.js:45:44
invoke
    runtime.js:135:28
Promise.resolve.then$argument_0
    runtime.js:145:19
tryCallOne
    core.js:37:14
setImmediate$argument_0
    core.js:123:25
_callTimer
    JSTimers.js:146:14
_callImmediatesPass
    JSTimers.js:194:17
callImmediates
    JSTimers.js:458:30

My code is pretty simple:

return (
    <Fragment>
      <View style={styles.applicationView}>
        <StatusBar barStyle='light-content' />
        <AppNavigation ref={ref => {
          NavigationService.setTopLevelNavigator(ref)
        }}
        onNavigationStateChange={ScreenTrackingService.track}
        />
      </View>
      <SnackBar />
    </Fragment>

Infos:
RN 0.61.1
"react-native-snackbar-component": "^1.1.2",
With Hermes

The problem is happening on both platforms.

I'l try to debug this deeper, but so far I've got nothing.

Thanks for the help!

i have this issue too!

i fixed this error by setting actionText as well as textMessage!
both of them must be set