-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.tsx
41 lines (35 loc) · 1.06 KB
/
App.tsx
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
import React, { useEffect } from 'react'
import { LogBox } from 'react-native'
import { Provider } from 'react-redux'
import * as TaskManager from 'expo-task-manager'
import * as Sentry from '@sentry/react-native'
import { SENTRY_DSN } from 'react-native-dotenv'
import { KeyboardProvider } from 'react-native-keyboard-controller'
import {
store,
resetReducer,
} from './src/stores'
import Navigator from './src/navigation/Navigator'
import { LOCATION_BACKGROUND_TASK } from './src/config/location'
import { locationBackgroundTask } from './src/helpers/taskManagerHelper'
Sentry.init({
dsn: SENTRY_DSN,
debug: false
})
LogBox.ignoreLogs(['EventEmitter.removeListener'])
TaskManager.defineTask(LOCATION_BACKGROUND_TASK, async ({ data: { locations } }) => {
await locationBackgroundTask(locations)
})
const App = () => {
useEffect(() => {
store.dispatch(resetReducer())
}, [])
return (
<Provider store={store}>
<KeyboardProvider>
<Navigator initialRoute={'login'} />
</KeyboardProvider>
</Provider>
)
}
export default Sentry.wrap(App)