-
Notifications
You must be signed in to change notification settings - Fork 27
/
index.tsx
56 lines (49 loc) · 1.77 KB
/
index.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import {LogBox, AppRegistry} from 'react-native';
import {App} from '@/app';
import {BaseComponent} from '@/base_component';
import {bootstrap} from '@/bootstrap';
import {handleDemoCommands} from '@/modules/activity';
import {onUpdateScreenWidgetRequested} from '@/modules/screen_widget';
import {setupNotifeeHandlers} from '@/notifee';
import {FullscreenAlarm} from '@/screens/fullscreen_alarm';
import {setUpdateWidgetsAlarms} from '@/tasks/set_update_widgets_alarms';
import {updateWidgets} from '@/tasks/update_widgets';
if (__DEV__) {
const ignoreWarns = [
'UNSAFE_componentWillReceiveProps',
'UNSAFE_componentWillMount',
'If you do not provide children, you must specify an aria-label for accessibility',
'In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app',
'[Reanimated] Tried to modify key `current` of an object which has been already passed to a worklet',
];
const warn = console.warn;
console.warn = (...arg) => {
for (const warning of ignoreWarns) {
if (arg[0].startsWith(warning)) {
return;
}
}
warn(...arg);
};
LogBox.ignoreLogs(ignoreWarns);
}
setupNotifeeHandlers();
onUpdateScreenWidgetRequested(async () => {
bootstrap();
await Promise.all([setUpdateWidgetsAlarms(), updateWidgets()]);
});
handleDemoCommands();
AppRegistry.registerRunnable('main-app', async initialProps => {
bootstrap();
AppRegistry.registerComponent('main-app', () =>
BaseComponent.bind(this, App),
);
AppRegistry.runApplication('main-app', initialProps);
});
AppRegistry.registerRunnable('fs-alarm', async initialProps => {
bootstrap();
AppRegistry.registerComponent('fs-alarm', () =>
BaseComponent.bind(this, FullscreenAlarm),
);
AppRegistry.runApplication('fs-alarm', initialProps);
});