-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
48 lines (42 loc) · 1.39 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
39
40
41
42
43
44
45
46
47
48
import React from 'react';
import { YellowBox } from 'react-native';
import { mapping } from '@eva-design/eva';
import { ApplicationProvider } from 'react-native-ui-kitten';
import { DynamicStatusBar } from './src/components/common';
import Router from './src/navigation/routes';
import { themes, customMapping } from './src/utils/themes';
import { GlobalState, useGlobalState } from './src/utils/context';
import NavigationService from './src/navigation/NavigationService';
import { setupExceptionHandlers } from './src/utils/errors';
// import whyDidYouRender from '@welldone-software/why-did-you-render';
// if (__DEV__) {
// whyDidYouRender(React);
// }
//
//
YellowBox.ignoreWarnings([
'Unrecognized WebSocket connection option(s) `agent`, `perMessageDeflate`, `pfx`, `key`, `passphrase`, `cert`, `ca`, `ciphers`, `rejectUnauthorized`. Did you mean to put these under `headers`?',
]);
setupExceptionHandlers();
const App = () => {
const [{ app }] = useGlobalState();
return (
<ApplicationProvider
mapping={mapping}
customMapping={customMapping}
theme={themes[app.properties.theme]}
>
<DynamicStatusBar currentTheme={app.properties.theme} />
<Router
ref={
(navigatorRef) => NavigationService.setTopLevelNavigator(navigatorRef)
}
/>
</ApplicationProvider>
);
};
export default () => (
<GlobalState>
<App />
</GlobalState>
);