generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
35 lines (30 loc) · 992 Bytes
/
index.js
File metadata and controls
35 lines (30 loc) · 992 Bytes
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
/**
* @format
*/
import '@react-native-firebase/app';
import {AppRegistry} from 'react-native';
import App from './src/App';
import {name as appName} from './app.json';
function BootErrorScreen({error}) {
const msg = String(error?.message ?? error);
const stack = String(error?.stack ?? '');
return (
<ScrollView contentContainerStyle={{padding: 16}}>
<Text style={{fontSize: 16, fontWeight: 'bold', marginBottom: 8}}>
Boot error
</Text>
<Text selectable style={{marginBottom: 8}}>{msg}</Text>
<Text selectable>{stack}</Text>
</ScrollView>
);
}
const getApp = () => {
try {
// IMPORTANT: require inside try/catch so top-level errors surface
return require('./src/App').default;
} catch (e) {
console.error('Boot error', e, e?.stack);
return () => <BootErrorScreen error={e} />;
}
};
AppRegistry.registerComponent('sap_sailing_insight', getApp);