-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
34 lines (29 loc) · 1.04 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
import * as ScreenOrientation from "expo-screen-orientation";
import React, { useEffect } from "react";
import { Platform } from "react-native";
import { enableScreens } from "react-native-screens";
import { ErrorBoundary } from "./src/components/ErrorBoundary";
import config from "./src/config/index";
import { RootNavigation } from "./src/navigation/routers/RootNavigation";
import { AppErrorScreen } from "./src/screens/AppError";
import { AppProviders } from "./src/utils/appProviders";
import { root as logger } from "./src/utils/loggers";
enableScreens();
function handleError(error: unknown, errorInfo: unknown) {
logger.error("error", error, errorInfo);
}
function App() {
useEffect(() => {
if (Platform.OS !== "web" && config.ui.lockScreenOrientation) {
ScreenOrientation.lockAsync(config.ui.lockScreenOrientation);
}
}, []);
return (
<ErrorBoundary ErrorScreen={AppErrorScreen} handleError={handleError}>
<AppProviders>
<RootNavigation />
</AppProviders>
</ErrorBoundary>
);
}
export default App;