Navigation in react-native error with stackNavigation - react-native

in the application I am creating I have set up bottom-tabs. They are functioning properly.
const Tab = createBottomTabNavigator();
export default function App() {
return (
<NavigationContainer>
<Tab.Navigator initialRouteName="Feed"
tabBarOptions={{activeTintColor: '#F78400'}}>
<Tab.Screen
name="Authentication" component={Authentication}
options={{
tabBarIcon: ({ focused, horizontal, tintColor }) => {
return (
<Image
source={require("./assets/images/authentication.jpg")}
style={{ width: 20, height: 20 }}
/>
);
}
}}
/>
<Tab.Screen
name="Dashboard"
component={Dashboard}
options={{
tabBarIcon: ({ focused, horizontal, tintColor }) => {
return (
<Image
source={require("./assets/images/dashboard.png")}
style={{ width: 20, height: 20 }}
/>
);
}
}}
/>
<Tab.Screen
name="Tools"
component={Tools}
options={{
tabBarIcon: ({ focused, horizontal, tintColor }) => {
return (
<Image
source={require("./assets/images/tools.png")}
style={{ width: 20, height: 20 }}
/>
);
}
}}
/>
<Tab.Screen
name="Settings"
component={Settings}
options={{
tabBarIcon: ({ focused, horizontal, tintColor }) => {
return (
<Image
source={require("./assets/images/settings.png")}
style={{ width: 20, height: 20 }}
/>
);
}
}}
/>
</Tab.Navigator>
</NavigationContainer>
);
}
So now, I want to set up navigation to be able to go from one screen to another. I added the code of the stacks to the code of my tabs and when I want to go on antorher screen, I click a button to go on another screen, the name of the screen appear at the top of the page but it looks like it still the first screen. I don't get what's wrong
view config getter callback for component,
could you please explain to me how to do? Thanks a lot.
import React from 'react'
import { Image } from 'react-native'
import { createBottomTabNavigator } from '#react-navigation/bottom-tabs'
import { createStackNavigator} from "#react-navigation/stack"
import { NavigationContainer } from '#react-navigation/native'
import Authentication from '../../Screens/Authentication'
import Login from '../../Screens/Authentication'
import Signup from '../../Screens/Authentication'
import Tools from '../../Screens/Tools'
import Dashboard from '../../Screens/Dashboard'
import Settings from '../../Screens/Settings'
import Scan from '../../Screens/Tools'
import i18n from '../../src/i18n'
const Tab = createBottomTabNavigator();
const Stack = createStackNavigator();
function ScreenNavigator() {
return(
<Stack.Navigator>
<Stack.Screen name = 'Authentication' component = {Authentication}/>
<Stack.Screen name = 'Login' component = {Login}/>
<Stack.Screen name = 'Signup' component = {Signup}/>
<Stack.Screen name = 'Tools' component = {Tools}/>
<Stack.Screen name = 'Scan' component = {Scan}/>
<Stack.Screen name = 'Dashboard' component = {Dashboard}/>
<Stack.Screen name = 'Settings' component = {Settings}/>
</Stack.Navigator>
)
}
export default function AppNavigation() {
return (
<NavigationContainer>
<Tab.Navigator initialRouteName="Feed"
tabBarOptions={{activeTintColor: '#F78400'}}>
<Tab.Screen
name={i18n.t("app.auth")}
component={ScreenNavigator}
options={{
tabBarIcon: ({ focused, horizontal, tintColor }) => {
return (
<Image
source={require("../../assets/images/authentication.jpg")}
style={{ width: 20, height: 20 }}
/>
);
}
}}
/>
<Tab.Screen
name={i18n.t("app.dash")}
component={Dashboard}
options={{
tabBarIcon: ({ focused, horizontal, tintColor }) => {
return (
<Image
source={require("../../assets/images/dashboard.png")}
style={{ width: 20, height: 20 }}
/>
);
}
}}
/>
<Tab.Screen
name={i18n.t("app.tools")}
component={Tools}
options={{
tabBarIcon: ({ focused, horizontal, tintColor }) => {
return (
<Image
source={require("../../assets/images/tools.png")}
style={{ width: 20, height: 20 }}
/>
);
}
}}
/>
<Tab.Screen
name={i18n.t("app.settings")}
component={Settings}
options={{
tabBarIcon: ({ focused, horizontal, tintColor }) => {
return (
<Image
source={require("../../assets/images/settings.png")}
style={{ width: 20, height: 20 }}
/>
);
}
}}
/>
</Tab.Navigator>
</NavigationContainer>
)
}

You are not passing components when initializing the navigation
The below code
<Stack.Screen name = 'Authentication' component = 'Authentication'/>
You have passed a string for component which is causing the error, this should change to
<Stack.Screen name = 'Authentication' component = {Authentication}/>
You will have to change other screens in the stack as well

Related

Hidding tab bar bottom navigation from certain route screens

I'm attempting to remove the tab bar bottom navigator from certain pages from my application. I have performed several searches with indication to use display:none or other methods, but they are not seeming to work. I have several nested routes inside of the Main route.
This is the tab route:
export function TabRoutes({ navigation }: any) {
const { Navigator, Screen } = createBottomTabNavigator();
const theme = useTheme();
return (
<Navigator
initialRouteName="FeedRt"
screenOptions={{
headerShown: false,
tabBarActiveTintColor: theme.colors.primary,
tabBarStyle: {
backgroundColor: theme.colors.tabBarBackground,
position: 'absolute',
borderTopRightRadius: 16,
borderTopLeftRadius: 16,
borderColor: '#9E9E9E',
borderWidth: RFValue(0.5),
borderStyle: 'solid',
bottom: -10,
height: 90,
paddingHorizontal: 16,
// tabBarStyle: { display: 'none' }
},
}}
>
<Screen
key="FeedRt"
name="FeedRt"
component={FeedRoutes}
options={{
tabBarIcon: ({ focused }) => (
<TabBarIconAndText text="Home" focused={focused} icon="Home" />
),
tabBarLabel: '',
}}
/>
<Screen
key="SearchRt"
name="SearchRt"
component={SearchRoutes}
options={{
tabBarIcon: ({ focused }) => (
<TabBarIconAndText text="Search" focused={focused} icon="Search" />
),
tabBarLabel: '',
}}
/>
<Screen
key="CreatePosts"
name="CreatePosts"
component={EmptyScreen}
listeners={({ navigation }) => ({
tabPress: (event) => {
event.preventDefault();
},
})}
options={{
tabBarIcon: ({ focused }) => (
<ToolTip navigation={navigation}>
<View
style={{
marginTop: 10,
flexDirection: 'row',
backgroundColor: theme.colors.primary,
width: 40,
height: 40,
borderRadius: 20,
justifyContent: 'center',
alignItems: 'center',
}}
>
<PlusSVG />
</View>
</ToolTip>
),
tabBarLabel: '',
}}
/>
<Screen
key="Shorts"
name="Shorts"
component={Shorts}
options={{
tabBarIcon: ({ focused }) => (
<TabBarIconAndText text="Shorts" focused={focused} icon="Shorts" />
),
tabBarLabel: '',
}}
/>
<Screen
key="Profile"
name="Profile"
children={() => <Profile navigation={navigation} myProfile={true} />}
options={{
tabBarIcon: ({ focused }) => (
<TabBarIconAndText text="Profile" focused={focused} icon="Profile" />
),
tabBarLabel: '',
}}
/>
</Navigator>
);
}
I want to remove the tab bar showing in the Comments from the FeedRoute
import React from 'react';
import { createStackNavigator } from '#react-navigation/stack';
// Screens
import { Feed } from '../screens/FeedScreens/Feed';
import { Comments } from '../screens/FeedScreens/Comments';
export function FeedRoutes() {
const { Navigator, Screen } = createStackNavigator();
return (
<Navigator initialRouteName="Posts" screenOptions={{ headerShown: false }}>
<Screen key="Posts" name="Posts" component={Feed} />
<Screen key="Comments" name="Comments" component={Comments} />
</Navigator>
);
}
And I have this App route witch calls the Main (Tab route):
import React from 'react';
import { createStackNavigator } from '#react-navigation/stack';
// Screens
import { TabRoutes } from './tab.routes';
import { PostRoutes } from './post.routes';
import { FeedRoutes } from './feed.routes';
export function AppRoutes() {
const { Navigator, Screen } = createStackNavigator();
return (
<Navigator initialRouteName="Main" screenOptions={{ headerShown: false }}>
<Screen key="Main" name="Main" component={TabRoutes} />
<Screen key="Post" name="Post" component={PostRoutes} />
</Navigator>
);
}
Want to remove it from this screen:
Just move Comments route from FeedRoutes to AppRoutes.
replace component={FeedRoutes} to component={Feed} in TabRoutes.
There is no need to create FeedRoutes component.
See more https://reactnavigation.org/docs/hiding-tabbar-in-screens/

State is updating but it is not updating the new value on scrren?

I don't seem to have any problems using setState in other pages of my project but in the app.js it just does not work? I am very new to react native.
I am calling the function 'handleacount' from another page and it gets the data and I just want to update the 'Acount'
The state is updating because it alerts but it does not update when it has already been rendered? Am I missing something?
The page App.js is :
import 'react-native-gesture-handler';
import React, { useState, Component } from "react";
import { MaterialCommunityIcons } from '#expo/vector-icons';
import { NavigationContainer } from '#react-navigation/native';
import { createStackNavigator } from '#react-navigation/stack';
import { createBottomTabNavigator } from '#react-navigation/bottom-tabs';
import Constants from 'expo-constants';
import IconBadge from 'react-native-icon-badge';
import { Text, View, StyleSheet } from 'react-native';
import HomeScreen from './pages/HomeScreen';
import SearchScreen from './pages/SearchScreen';
import SettingsScreen from './pages/SettingsScreen';
import MapScreen from './pages/MapScreen';
import NotificationsScreen from './pages/NotificationsScreen';
import { ListItem, Avatar, Badge, Icon, withBadge } from 'react-native-elements'
const Stack = createStackNavigator();
const Tab = createBottomTabNavigator();
const MessagesIcon = ({ tintColor }) => (
<Icon
type="MaterialCommunityIcons"
name="checkcircle"
size={24}
color={tintColor}
/>
);
function HomeStack() {
return (
<Stack.Navigator>
<Stack.Screen
name="Home"
component={HomeScreen}
options={{ title: 'Home Page', headerShown: false }}
/>
<Stack.Screen
name="Search"
component={SearchScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Notifications"
component={NotificationsScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name="Map"
component={MapScreen}
changeoptions={{ headerShown: false }}
/>
<Stack.Screen
name="Settings"
component={SettingsScreen}
changeoptions={{ headerShown: false }}
/>
</Stack.Navigator>
);
}
function SettingsStack() {
return (
<Stack.Navigator>
<Stack.Screen
name="Settings"
component={SettingsScreen}
options={{ headerShown: false }}
/>
</Stack.Navigator>
);
}
function App() {
function App() {
const [Acount, setAcount] = useState(0)
this.state = {
Acount: 2
};
handleacount = (data) => {
this.state = {
Acount: 9
};
alert(this.state.acount)
}
return (
<NavigationContainer>
<Tab.Navigator
tabBarOptions={{
activeTintColor: '#b08cf3',
inactiveTintColor: 'black',
}}>
<Tab.Screen
name="HomeStack"
component={HomeScreen}
options={{
tabBarLabel: 'Home',
tabBarIcon: ({ color, size }) => (
<MaterialCommunityIcons name="home" color={color} size={30} />
),
}}
/>
<Tab.Screen
name="SearchStack"
component={SearchScreen}
options={{
tabBarLabel: 'Search',
tabBarIcon: ({ color, size }) => (
<MaterialCommunityIcons
name="account-search"
color={color}
size={30}
/>
),
}}
/>
<Tab.Screen
name="NotificationsStack"
component={NotificationsScreen}
options={{
tabBarBadge: 5,
tabBarLabel: 'Notifications',
tabBarIcon: ({ color, size }) => (
<MaterialCommunityIcons name="bell" color={color} size={30} />
),
}}
/>
<Tab.Screen
name="MapStack"
component={MapScreen}
options={{
tabBarLabel: 'Map',
tabBarIcon: ({ focused, color, size }) => {
return (
<View>
<MaterialCommunityIcons name="map-marker" size={30} color='rgb(68,68,68)' style={{ marginTop:0 }}/>
<View style={{position:'absolute', bottom:32, left:-38 }}>
<IconBadge
MainElement={
<View>
</View>
}
BadgeElement={
// here your text in badge icon
<Text style={{fontWeight: 900,fontFamily: "sans-serif-medium",
fontSize: 14,color:'#FFFFFF', Top:10 }}>{ this.state.acount }</Text>
}
IconBadgeStyle={
{width:20,
height:20,
borderWidth: 2,
borderColor: "#b5b5b5",
backgroundColor: '#ff8a8a'}
}
/></View>
</View>
);
},
}}
/>
<Tab.Screen
name="SettingsStack"
component={SettingsScreen}
options={{
tabBarLabel: 'Account',
tabBarIcon: ({ color, size }) => (
<MaterialCommunityIcons
name="account"
color={color}
size={30}
/>
),
}}
/>
</Tab.Navigator>
</NavigationContainer>
);
}
const styles = StyleSheet.create({
container: {
flex: 1
}
});
export default App;
State belongs to the component so you should move it inside the App component like this
function App() {
const [account, setAccount] = useState(0)
...
}
But how do you call the setAccount from another page you wonder and there you need to have a look into React Context or Redux.
Context: https://reactjs.org/docs/context.html
Redux: https://redux.js.org/
I sorted it by place this in another page:
<Button
onPress={() => {increment(2)}} title="Click Me"
/>
Then in the function App I added
// State: a counter value
const [counter, setCounter] = useState(0)
increment = (data) => {
setCounter(data)
}
Not entirely sure how or why this works though?

React Native Top Area View

I'm new to React Native and I have a very simple first page that I'm testing out. My only thing I'm having a hard time understanding is where there is a Title view at the top area. Here's what my app currently looks like https://i.stack.imgur.com/H7vbO.png As you can see, there's that huge white space that has "Home" in it. I'm trying to get rid of it completely and just have the my background color throughout the whole thing. My only problem is that I don't even know where that is coming from. Here is my code and thank you.
This is my HomeScreen
import React from "react";
import { StyleSheet, Text, SafeAreaView, Platform } from "react-native";
import { StatusBar } from "expo-status-bar";
const HomeScreen = ({}) => {
return (
<SafeAreaView style={styles.container}>
<Text style={{ color: "white" }}>Home Screen</Text>
</SafeAreaView>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#4B4B4B",
alignItems: "center",
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
},
});
export default HomeScreen;
This is my App.js
import React from "react";
import { NavigationContainer } from "#react-navigation/native";
import { createNativeStackNavigator } from "#react-navigation/native-stack";
import MainTabScreen from "./screens/MainTabScreen";
const Stack = createNativeStackNavigator();
const App = () => {
return (
<NavigationContainer>
<MainTabScreen />
</NavigationContainer>
);
};
export default App;
Here is my MainTabScreen
import React from "react";
import { createBottomTabNavigator } from "#react-navigation/bottom-tabs";
import Icon from "react-native-vector-icons/Ionicons";
import HomeScreen from "./HomeScreen";
import SearchScreen from "./SearchScreen";
import InboxScreen from "./InboxScreen";
import AccoutScreen from "./AccountScreen";
const Tab = createBottomTabNavigator();
const MainTabScreen = () => {
return (
<Tab.Navigator initialRouteName="Home" activeColor="#000000">
<Tab.Screen
name="Home"
component={HomeScreen}
options={{
tabBarIcon: ({ color }) => (
<Icon name="ios-home" color={color} size={26} />
),
}}
/>
<Tab.Screen
name="Search"
component={SearchScreen}
options={{
tabBarIcon: ({ color }) => (
<Icon name="ios-search" color={color} size={26} />
),
}}
/>
<Tab.Screen
name="Inbox"
component={InboxScreen}
options={{
tabBarIcon: ({ color }) => (
<Icon name="ios-chatbox" color={color} size={26} />
),
}}
/>
<Tab.Screen
name="Account"
component={AccoutScreen}
options={{
tabBarIcon: ({ color }) => (
<Icon name="ios-person" color={color} size={26} />
),
}}
/>
</Tab.Navigator>
);
};
export default MainTabScreen;
P.S.: I already tried changing SafeAreaView to just View, and I also try removing the padding top
That view is actually the header of the navigator. Thus, to remove it, on your main navigator, set headerShown: false.
In your mainTabScreen;
<Tab.Navigator screenOptions={{headerShown: false}} initialRouteName="Home" activeColor="#000000">
...
Rest will be same.
Bottom tab accepts header related options in options property of Navigator Screens and screenOptions property in The Navigator Component
e.g
const MainTabScreen = () => {
return (
<Tab.Navigator
initialRouteName="Home"
activeColor="#000000"
// To remove header from all screens,
// screenOptions={{ headerShown: false }}
>
<Tab.Screen
name="Home"
component={Home}
options={{
tabBarIcon: ({ color }) => (
<Icon name="ios-home" color={color} size={26} />
),
// Update Header Title
// headerTitle: 'NOT A HOME',
}}
/>
<Tab.Screen
name="Search"
component={Home}
options={{
tabBarIcon: ({ color }) => (
<Icon name="ios-search" color={color} size={26} />
),
}}
/>
</Tab.Navigator>
);
};
You can read about all header related options in - https://reactnavigation.org/docs/elements#header

Can't call a nested navigation screen from a deep component in react native

I have followed this tutorial and created Drawer and Main Tab Navigations for my react native expo app.
Now I need a screen which should not be listed in Drawer or Tab and which is needed to be called from a deep component where navigations props are not being sent.
I tried useNavigation Hook but got error where react native is unable to find any such screen name.
PFB the tentative sample codes:
Main Tab called from App.js
const Tab = createMaterialBottomTabNavigator();
const HomeStack = createStackNavigator();
const ProfileStack = createStackNavigator();
const ListStack = createStackNavigator();
const MainTabScreen = () => (
<Tab.Navigator
initialRouteName="Home"
activeColor="#fff"
barStyle={{ backgroundColor: '#009387' }}
>
<Tab.Screen
name="Home"
component={HomeStackScreen}
options={{
tabBarLabel: 'Home',
tabBarColor: '#009387',
tabBarIcon: ({ color }) => (
<Icon name="home" color={color} size={26} />
),
}}
/>
<Tab.Screen
name="Profile"
component={ProfileStackScreen}
options={{
tabBarLabel: 'Profile',
tabBarColor: '#1f65ff',
tabBarIcon: ({ color }) => (
<Icon name="aperture" color={color} size={26} />
),
}}
/>
</Tab.Navigator>
);
export default MainTabScreen;
const HomeStackScreen = ({navigation}) => (
<HomeStack.Navigator screenOptions={{
headerStyle: {
backgroundColor: '#009387',
},
headerTintColor: '#fff',
headerTitleStyle: {
fontWeight: 'bold'
}
}}>
<HomeStack.Screen name = "Home" component = {Home}
options = {{
title: 'Overview',
headerLeft: () => (
<Icon.Button name="menu" size={25}
backgroundColor="#009387" onPress={()=>navigation.openDrawer()}
></Icon.Button>
)
}}
/>
</HomeStack.Navigator>
);
const ProfileStackScreen = ({navigation}) => (
<ProfileStack.Navigator screenOptions={{
headerStyle: {
backgroundColor: '#d02860',
},
headerTintColor: '#fff',
headerTitleStyle: {
fontWeight: 'bold'
}
}}>
<ProfileStack.Screen name = "Profile" component = {Profile}
options = {{
headerLeft: () => (
<Icon.Button name="menu" size={25}
backgroundColor="#d02860" onPress={()=>navigation.openDrawer()}
></Icon.Button>
)
}}
/>
</ProfileStack.Navigator>
);
const ListStackScreen = ({navigation}) => (
<NotificationsStack.Navigator screenOptions={{
headerStyle: {
backgroundColor: '#694fad',
},
headerTintColor: '#fff',
headerTitleStyle: {
fontWeight: 'bold'
}
}}>
<ListStack.Screen name = "List" component = {List}
options = {{
headerLeft: () => (
<Icon.Button name="menu" size={25}
backgroundColor="#694fad" onPress={()=>navigation.openDrawer()}
></Icon.Button>
)
}}
/>
</NotificationsStack.Navigator>
);
useNavigation component section:
import { useNavigation } from '#react-navigation/native';
.
.
.
const SomeStuff = ({item}) => {
......
<ListButton title={Count} screenName="ListStackScreen" />
.....
}
.
.
function ListButton({ title, screenName }) {
const navigation = useNavigation();
return (
<Button
title={`${title} Total`}
onPress={() => navigation.navigate(screenName)}
/>
);
}
also tried:
navigation.navigate('HomeDrawer',{screen: screenName})
I need to call the above ListStackScreen from a deep component. I tried using navigation.navigate(ListStackScreen) but it doesn't work as explained above.
Please let me know how to use the screen without displaying it in any Drawer or Tab visually.
Edit: Update after trying the given answer
I do have this in the main app.js also:
<Drawer.Screen name="HomeDrawer" component={MainTabScreen} />
This setup should allow you to navigate between HomeStackScreen and ListStackScreen.
const Stack = createStackNavigator();
function HomeStack() {
return (
<Stack.Navigator
initialRouteName="HomeStackScreen">
<Stack.Screen
name="HomeStackScreen"
component={HomeStackScreen}
/>
<Stack.Screen
name="ListStackScreen"
component={ListStackScreen}
/>
</Stack.Navigator>
);
}
<NavigationContainer>
<Tab.Navigator
initialRouteName="HomeStack">
<Tab.Screen
name="HomeStack"
component={HomeStack}
}}
/>
…
You can nest stacknavigator into Drawer, the inner stacknavigator screen won‘t be shown in Drawer.
I have created an sample

undefined is not an object (evaluating 'object.keys(routeConfigs)') [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
This is the error I am receiving. Please tell me what file you need to see. Apologies if the problem is not to the point, I am a noob here.
First image shows the error
Below is the file which calls for stack navigator.
This file calls for stacknavigator
If you need anything else, please tell me, I'll add it in further edits
import React from "react";
import { Easing, Animated, Dimensions } from "react-native";
//import {createAppContainer} from 'react-navigation';
import {createStackNavigator} from 'react-navigation-stack';
import { createDrawerNavigator,DrawerItems} from 'react-navigation-drawer';
//import { createBottomTabNavigator } from 'react-navigation-bottom-tabs';
import { Block } from "galio-framework";
// screens
import HomeActivity from '../components/HomeActivity.js';
import ProfileActivity from '../components/ProfileActivity.js';
import Results from '../components/Results.js';
// import HomeActivity from "../screens/Home";
// import Onboarding from "../screens/Onboarding";
import Pro from "../components/Pro";
import Profile from "../components/Profile";
// import Register from "../screens/Register";
// import Elements from "../screens/Elements";
// import Articles from "../screens/Articles";
// drawer
import CustomDrawerContent from "./Menu";
// header for screens
import Icon from "../components/Icon";
import Header from "../components/Header";
import { argonTheme, tabs } from "../constants";
const { width } = Dimensions.get("screen");
const Stack = createStackNavigator();
const Drawer = createDrawerNavigator();
//const Tab = createBottomTabNavigator();
function ElementsStack(props) {
return (
<Stack.Navigator mode="card" headerMode="screen">
<Stack.Screen
name="Elements"
component={Profile}
options={{
header: ({ navigation, scene }) => (
<Header title="Elements" navigation={navigation} scene={scene} />
),
cardStyle: { backgroundColor: "#F8F9FE" }
}}
/>
<Stack.Screen
name="Pro"
component={Pro}
options={{
header: ({ navigation, scene }) => (
<Header
title=""
back
white
transparent
navigation={navigation}
scene={scene}
/>
),
headerTransparent: true
}}
/>
</Stack.Navigator>
);
}
function ArticlesStack(props) {
return (
<Stack.Navigator mode="card" headerMode="screen">
<Stack.Screen
name="Articles"
component={Articles}
options={{
header: ({ navigation, scene }) => (
<Header title="Articles" navigation={navigation} scene={scene} />
),
cardStyle: { backgroundColor: "#F8F9FE" }
}}
/>
<Stack.Screen
name="Pro"
component={Pro}
options={{
header: ({ navigation, scene }) => (
<Header
title=""
back
white
transparent
navigation={navigation}
scene={scene}
/>
),
headerTransparent: true
}}
/>
</Stack.Navigator>
);
}
function ProfileStack(props) {
return (
<Stack.Navigator initialRouteName="Profile" mode="card" headerMode="screen">
<Stack.Screen
name="Profile"
component={ProfileActivity}
options={{
header: ({ navigation, scene }) => (
<Header
transparent
white
title="Profile"
navigation={navigation}
scene={scene}
/>
),
cardStyle: { backgroundColor: "#FFFFFF" },
headerTransparent: true
}}
/>
<Stack.Screen
name="Pro"
component={Pro}
options={{
header: ({ navigation, scene }) => (
<Header
title=""
back
white
transparent
navigation={navigation}
scene={scene}
/>
),
headerTransparent: true
}}
/>
</Stack.Navigator>
);
}
function HomeStack(props) {
return (
<Stack.Navigator mode="card" headerMode="screen">
<Stack.Screen
name="Home"
component={HomeActivity}
options={{
header: ({ navigation, scene }) => (
<Header
title="Home"
search
options
navigation={navigation}
scene={scene}
/>
),
cardStyle: { backgroundColor: "#F8F9FE" }
}}
/>
<Stack.Screen
name="Pro"
component={Pro}
options={{
header: ({ navigation, scene }) => (
<Header
title=""
back
white
transparent
navigation={navigation}
scene={scene}
/>
),
headerTransparent: true
}}
/>
</Stack.Navigator>
);
}
export default function OnboardingStack(props) {
return (
<Stack.Navigator mode="card" headerMode="none">
<Stack.Screen
name="Jobs"
component={Results}
option={{
headerTransparent: true
}}
/>
<Stack.Screen name="App" component={AppStack} />
</Stack.Navigator>
);
}
function AppStack(props) {
return (
<Drawer.Navigator
style={{ flex: 1 }}
drawerContent={props => <CustomDrawerContent {...props} />}
drawerStyle={{
backgroundColor: "white",
width: width * 0.8
}}
drawerContentOptions={{
activeTintcolor: "white",
inactiveTintColor: "#000",
activeBackgroundColor: "transparent",
itemStyle: {
width: width * 0.75,
backgroundColor: "transparent",
paddingVertical: 16,
paddingHorizonal: 12,
justifyContent: "center",
alignContent: "center",
alignItems: "center",
overflow: "hidden"
},
labelStyle: {
fontSize: 18,
marginLeft: 12,
fontWeight: "normal"
}
}}
initialRouteName="Home"
>
<Drawer.Screen name="Home" component={HomeStack} />
<Drawer.Screen name="Profile" component={ProfileStack} />
<Drawer.Screen name="Results" component={OnboardingStack} />
<Drawer.Screen name="Elements" component={ElementsStack} />
{/* <Drawer.Screen name="Articles" component={ArticlesStack} /> */}
</Drawer.Navigator>
);
}
So based on the error i would say that validateRouteConfigMap.js is getting an object(routeConfigs) that you've not yet defined or passed in as undefined or you have not set a default value for. Remember Object.keys(ARRAY_OR_OBJECT_VARIABLE) requires a variable of object type (besides null)