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>
);
}