react-native-selectable-text icon indicating copy to clipboard operation
react-native-selectable-text copied to clipboard

Does not work in my Expo project

Open Jake-Ruston opened this issue 2 years ago • 3 comments

I'm unable to get this library working on my iOS device. There are no errors until I navigate to the page with the SelectableText.

Error Text:

ERROR  Invariant Violation: requireNativeComponent: "RNSelectableText" was not found in the UIManager.

This error is located at:
    in RNSelectableText (created by SelectableText)
    in SelectableText (created by Submission)
    in RCTView (created by View)
    in View (created by Submission)
    in RCTView (created by View)
    in View (created by Container)
    in Container (created by Submission)
    in Submission (created by SceneView)
    in StaticContainer
    in EnsureSingleNavigator (created by SceneView)
    in SceneView (created by BottomTabView)
    in RCTView (created by View)
    in View (created by Screen)
    in RCTView (created by View)
    in View (created by Background)
    in Background (created by Screen)
    in Screen (created by BottomTabView)
    in RNSScreen (created by AnimatedComponent)
    in AnimatedComponent
    in AnimatedComponentWrapper (created by InnerScreen)
    in Suspender (created by Freeze)
    in Suspense (created by Freeze)
    in Freeze (created by DelayedFreeze)
    in DelayedFreeze (created by InnerScreen)
    in InnerScreen (created by Screen)
    in Screen (created by MaybeScreen)
    in MaybeScreen (created by BottomTabView)
    in RNSScreenNavigationContainer (created by ScreenContainer)
    in ScreenContainer (created by MaybeScreenContainer)
    in MaybeScreenContainer (created by BottomTabView)
    in RNCSafeAreaProvider (created by SafeAreaProvider)
    in SafeAreaProvider (created by SafeAreaInsetsContext)
    in SafeAreaProviderCompat (created by BottomTabView)
    in BottomTabView (created by BottomTabNavigator)
    in PreventRemoveProvider (created by NavigationContent)
    in NavigationContent
    in Unknown (created by BottomTabNavigator)
    in BottomTabNavigator (created by App)
    in EnsureSingleNavigator
    in BaseNavigationContainer
    in ThemeProvider
    in NavigationContainerInner (created by App)
    in App (created by withDevTools(App))
    in withDevTools(App)
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in main(RootComponent)

This is my code:

import { SelectableText } from '@alentoma/react-native-selectable-text';
...
      <View style={styles.submission}>
        <SelectableText
          style={styles.submissionContent}
          menuItems={['one', 'two']}
          onSelection={({ eventType, content, selectionStart, selectionEnd }) => {}}
          value={submission.content}
        ></SelectableText>
      </View>

And I run my project with npx expo start.

Edit: Yes I do have the react-native-config.js in my project root. Although I am unsure if I need to import it anywhere or do anything other than have it just "exist".

Jake-Ruston avatar Feb 12 '23 00:02 Jake-Ruston