-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
37 lines (33 loc) · 1.04 KB
/
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
34
35
36
37
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { NavigationContainer } from '@react-navigation/native';
import { useEffect, useState } from 'react';
import { initDB } from './database/localdb';
import { MainStack } from './navigations/MainStack';
import { AboutScreen } from './screens/AboutScreen';
export default function App() {
const [dbInitialized, setDbInitialized] = useState(false);
const BottomTab = createBottomTabNavigator();
useEffect(() => {
initDB()
.then(res => {
console.log(res)
setDbInitialized(true)
})
.catch(err => console.log(err))
}, []);
return (
<NavigationContainer>
<BottomTab.Navigator screenOptions={{headerShown: false}}>
<BottomTab.Screen
name='MainStack'
component={MainStack}
initialParams={{dbInitialized: dbInitialized}}
/>
<BottomTab.Screen
name='About'
component={AboutScreen}
/>
</BottomTab.Navigator>
</NavigationContainer>
);
};