-
Notifications
You must be signed in to change notification settings - Fork 283
/
App.js
38 lines (33 loc) · 1.11 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
38
import React, { useEffect } from 'react';
import SplashScreen from 'react-native-splash-screen';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import 'text-encoding-polyfill';
import 'array-flat-polyfill';
import { Entry } from './app/Entry';
import { TracingStrategyProvider } from './app/TracingStrategyContext';
import VersionCheckService from './app/services/VersionCheckService';
import { store, persistor } from './app/store';
import gpsStrategy from './app/gps';
import BackgroundTaskService from './app/services/BackgroundTaskService';
// For snapshot testing. In tests, we provide a mock store wrapper if needed.
export const UnconnectedApp = () => (
<TracingStrategyProvider strategy={gpsStrategy}>
<Entry />
</TracingStrategyProvider>
);
const App = () => {
useEffect(() => {
SplashScreen.hide();
VersionCheckService.start();
BackgroundTaskService.start();
}, []);
return (
<Provider store={store}>
<PersistGate persistor={persistor}>
<UnconnectedApp />
</PersistGate>
</Provider>
);
};
export default App;