import { View, Text } from 'react-native'
import React from 'react'
import { NavigationContainer } from '@react-navigation/native'
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { Octicons } from '@expo/vector-icons';
import Dashboard from '../app/Dashboard'
import Timetable from '../app/Timetable'
const Tab = createBottomTabNavigator();
const dashboard = 'Home';
const timetable = 'Timetable';
export default function TabNavigation() {
return (
<NavigationContainer>
<Tab.Navigator
initialRouteName={dashboard}
screenOptions={(
{route}) => ({
tabBarIcon: ({focused, color, size}) => {
let iconName;
let rn = route.name;
if (rn === dashboard) {
iconName = focused ? 'home' : 'home-outline'
} else if (rn === timetable) {
iconName = focused ? 'home' : 'home-outline'
}
return <Octicons name={iconName} size={size} color={color}/>
},
})}>
<Tab.Screen name={dashboard} component={Dashboard}/>
<Tab.Screen name={timetable} component={Timetable}/>
</Tab.Navigator>
</NavigationContainer>
);
}
Expecting two tabs to appear across the bottom of the IOS XCode simulator, one for Dashboard and one for Timetable, but nothing is showing. Unsure where l have gone wrong here. Any help or explanation would be much appreciated.
Am not getting any errors so unsure why its not showing. I am using Expo CLI.