Attempt attach child that is not of type RNScreen

Viewed 256

I am getting this error in my application after recent upgrade from react-navigation v4 to v6.

Attempt attach child that is not of type RNScreen

Here is my Navigation for the application.

function switchNavigator() {
  return (
    <NavigationContainer>
      <Stack.Navigator initialRouteName="loginFlow">
        <Stack.Screen name="loginFlow" component={loginFlow} />
        <Stack.Screen name="mainFlow" component={mainFlow} />
      </Stack.Navigator>
    </NavigationContainer>
  );
}
1 Answers

I ran into this same problem and was beyond confused on why this was happening. My problem was that I had installed Expo version 40. React Navigation documentation specifically explains in Getting Started that you must use expo version higher or equal to 41 at the time I am writing this. This fixed my issue so I would check this first and see if you have installed packages that don't work with React Navigation.

These are the minimum requirements (Taken from their site):

  • react-native >= 0.63.0
  • expo >= 41 (if you use Expo)
  • typescript >= 4.1.0
Related