Skip to content

Instantly share code, notes, and snippets.

@aditodkar
Last active September 25, 2019 10:52
Show Gist options
  • Save aditodkar/bec3efa10df9be1457b154c6495be95f to your computer and use it in GitHub Desktop.
Save aditodkar/bec3efa10df9be1457b154c6495be95f to your computer and use it in GitHub Desktop.
import React from 'react';
import {View} from 'react-native';
import RootNavigator from './src/navigation/navigation';
const App = () => {
return (
<View>
<RootNavigator />
</View>
);
};
export default App;
import React from 'react';
import {View} from 'react-native';
import {createBottomTabNavigator} from 'react-navigation-tabs';
import {createAppContainer} from 'react-navigation';
import {createStackNavigator} from 'react-navigation-stack';
import HomeScreen from '../components/home/home';
import BookingScreen from '../components/booking/booking';
import AccountScreen from '../components/account/account';
const HomeStack = createStackNavigator({
Home: {
screen: HomeScreen,
},
});
const BookingStack = createStackNavigator({
Booking: {
screen: BookingScreen,
},
});
const AccountStack = createStackNavigator({
Account: {
screen: AccountScreen,
},
});
const TabNavigator = createBottomTabNavigator(
{
HomeTab: {
screen: HomeStack,
navigationOptions: {
tabBarLabel: 'Home',
},
},
BookingTab: {
screen: BookingStack,
navigationOptions: {
tabBarLabel: 'Booking',
},
},
AccountTab: {
screen: AccountStack,
navigationOptions: {
tabBarLabel: 'Account',
},
},
},
{
initialRouteName: 'HomeTab',
},
);
const RootNavigator = createAppContainer(TabNavigator);
export default RootNavigator;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment