question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Attempt attach child that is not of type RNScreen

See original GitHub issue

I have the next AppNavigation file:

import { createAppContainer, createSwitchNavigator } from 'react-navigation';
import { createDrawerNavigator } from 'react-navigation-drawer';
import createNativeStackNavigator from 'react-native-screens/createNativeStackNavigator'
import { Animated, Easing } from 'react-native';

const ModalStack = createNativeStackNavigator(
  {
    ScreenA,
    ScreenB,
  },
  {
    mode: 'modal',
    headerMode: 'none',
    transparentCard: true,
    transitionConfig: () => ({
      transitionSpec: {
        duration: 500,
        easing: Easing.out(Easing.poly(4)),
        timing: Animated.timing,
        useNativeDriver: true,
      },
      screenInterpolator: (sceneProps: NavigationTransitionProps) => {
        const { position, scene } = sceneProps;
        const thisSceneIndex = scene.index;
        const opacity = position.interpolate({
          inputRange: [thisSceneIndex - 1, thisSceneIndex],
          outputRange: [0, 1],
        });

        return { opacity };
      },
    }),
  },
);

const RootNavigator = createSwitchNavigator(
  {
    ScreenC,
    ScreenD,
  },
  {
    initialRouteName: 'ScreenC',
  },
);

const DrawerNavigator = createDrawerNavigator(
  {
    App: {
      screen: RootNavigator,
      navigationOptions: {
        drawerLabel: () => null,
      },
    },
  },
  {
    contentComponent: Drawer,
  },
);

const AppContainer = createAppContainer(DrawerNavigator);

export default AppContainer;

but I’m getting this error Screenshot_20190919-171537_Happy Pineapple Dev

System:
    OS: macOS 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 562.58 MB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.16.3 - ~/.nvm/versions/node/v10.16.3/bin/node
    Yarn: 1.15.2 - /usr/local/bin/yarn
    npm: 6.9.0 - ~/.nvm/versions/node/v10.16.3/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    Android SDK:
      API Levels: 23, 25, 26, 27, 28
      Build Tools: 23.0.1, 28.0.3, 29.0.2
      System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
      Android NDK: 19.2.5345600
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5791312
    Xcode: /undefined - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.4 => 0.60.4
    react-navigation: "4.0.5",
    react-navigation-drawer: "2.2.1",
    react-navigation-stack: "1.8.0",
    react-navigation-tabs: "2.5.3",
    react-native-screens: "^2.0.0-alpha.3"

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

12reactions
Osamasomycommented, Oct 13, 2021

@sndp07

import {enableScreens} from ‘react-native-screens’ enableScreens()

just put these two lines at the top of the App.js

5reactions
kacperkapusciakcommented, Oct 14, 2021

@Osamasomy since react-native-screen v3.0.0 this is no longer required and @react-navigation/native-stack requires a version equal or greater than that

Read more comments on GitHub >

github_iconTop Results From Across the Web

react native - Attempt attach child that is not of type RNScreen
I am getting this error in my application after recent upgrade from react-navigation v4 to v6. Attempt attach child that is not of...
Read more >
react-native-screens - npm
This project aims to expose native navigation container components to React Native. It is not designed to be used as a standalone library ......
Read more >
Troubleshooting | React Navigation
This section attempts to outline issues that users frequently encounter when first getting accustomed to using React Navigation. These issues may or may...
Read more >
"RNSScreen" was not found in the UIManager. - Code Grepper
rnsscreen was not found in the uimanager · Oops, You will need to install Grepper and log-in to perform this action.
Read more >
react-native-reanimated: Versions - Openbase
Fix Jest 28+ expect.extend is not a function error by @yusufyildirim in ... Fix incorrect build type resolution on Android by @Kwasow in ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found