-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
33 lines (29 loc) · 1011 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import React from 'react'
import { NavigationContainer } from '@react-navigation/native'
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
import { Ionicons } from '@expo/vector-icons'
import Home from './components/Home'
import AnotherPage from './components/AnotherPage'
const Tab = createBottomTabNavigator()
export default function App() {
return (
<NavigationContainer>
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName
if (route.name === 'Home') {
iconName = 'md-home'
} else if (route.name === 'AnotherPage') {
iconName = 'ios-help'
}
return <Ionicons name={iconName} size={size} color={color} />
},
})}
>
<Tab.Screen name="Home" component={Home} />
<Tab.Screen name="AnotherPage" component={AnotherPage} />
</Tab.Navigator>
</NavigationContainer>
)
}