-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
42 lines (37 loc) · 1 KB
/
App.tsx
File metadata and controls
42 lines (37 loc) · 1 KB
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
38
39
40
41
42
import 'react-native-gesture-handler'
import React from 'react'
import {useEffect} from 'react'
import {NavigationContainer} from '@react-navigation/native'
import {useAppDispatch, useAppSelector} from 'app/hooks'
import {loadAuth} from 'features/auth/authSlice'
import {loadConfig} from 'features/config/configSlice'
import {selectConfig} from 'features/config/configSlice'
import {View} from 'react-native'
import {Provider} from 'react-redux'
import {store} from 'app/store'
import BottomTabNavigator from 'navigation/BottomTabNavigator'
const AppWrapper = () => {
return (
<Provider store={store}>
<App />
</Provider>
)
}
const App = () => {
const dispatch = useAppDispatch()
useEffect(() => {
dispatch(loadAuth())
dispatch(loadConfig())
}, [dispatch])
const config = useAppSelector(selectConfig)
if (config) {
return (
<NavigationContainer>
<BottomTabNavigator />
</NavigationContainer>
)
} else {
return <View />
}
}
export default AppWrapper