after applying authentication flow in react navigation 6 this error is appearing

Viewed 74

This is my ShopNavigator.js as you see there is authentication flow i have applied but it is showing this error even the screen name is corret. Does anyone know how to resolve this issue before it is switchNavigator in reactNavigation 6.

const Stack = createStackNavigator();

const Drawer = createDrawerNavigator();

function ShopNavigator() {
    const dispatch = useDispatch();
    return (
        <NavigationContainer>
            <Drawer.Navigator initialRouteName="StartUp" drawerContent={props => {
                return (
                    <View style={{ flex: 1, paddingTop: 5 }}>
                        <DrawerContentScrollView {...props}>
                            <SafeAreaView forceInset={{ top: "always", horizontal: "never", }}>
                                <DrawerItemList {...props} />
                                <DrawerItem {...props}
                                    label="logout"
                                    color="red"
                                    onPress={() => {
                                        dispatch(authActions.logout());
                                        props.navigation.navigate("AuthScreen")
                                    }}
                                />
                            </SafeAreaView>
                        </DrawerContentScrollView>
                    </View>
                )
            }}
            >
                {authActions.AUTHENTICATE ? (
                    <Stack.Group>
                        <Stack.Screen name="StartUp" component={StartupScreen}
                            options={{
                                drawerItemStyle: { height: 0 }
                            }} />
                        <Drawer.Screen name="AuthScreen" component={AuthScreen}
                            options={{
                                drawerItemStyle: { height: 0 }
                            }} />
                    </Stack.Group>
                ) : (

                    <Stack.Group>
                        <Drawer.Screen name="ProductsOverviewScreen" component={ProductOverviewScreen}
                            options={{
                                title: "Home",
                                drawerIcon: drawerConfig => (
                                    <Ionicons name="md-home"
                                        size={23}
                                        color="green" />
                                ),
                            }}
                        />
                        )}
 </Drawer.Navigator>
        </NavigationContainer>
)};

This error it is showing even the screen name is Correct

0 Answers
Related