Repository navigation
Expand file tree
/
Copy pathindex.js
More file actions
59 lines (48 loc) · 1.63 KB
/
Copy pathindex.js
File metadata and controls
59 lines (48 loc) · 1.63 KB
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
57
58
59
import 'react-native-get-random-values'; // Must be the very first line
import { AppRegistry } from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { name as appName } from './app.json';
import { Buffer } from "buffer"
// Polyfill Buffer
global.Buffer = Buffer
// Polyfill Process/nextTick
if (typeof process === 'undefined') {
global.process = require('process');
}
if (!process.nextTick) {
global.process = global.process || {};
global.process.nextTick = setImmediate;
}
// Polyfill TextEncoder/Decoder (The Protobuf Fix)
// We import specifically from sinonjs to handle the {fatal: true} option
import { TextEncoder, TextDecoder } from '@sinonjs/text-encoding';
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;
if (typeof structuredClone==='undefined') {
global.structuredClone = (o)=> {
try {
return JSON.parse(JSON.stringify(o))
} catch {}
}
}
// Polyfill Array.prototype.toSorted (Hermes 0.14.1 does not implement this ES2023 method)
if (!Array.prototype.toSorted) {
Array.prototype.toSorted = function(compareFn) {
return this.slice().sort(compareFn);
};
}
/* required of default exports of events are used
const EventEmitter = require('events');
if (!EventEmitter.default) {
EventEmitter.default = EventEmitter;
}
*/
import { installCrashReporting } from './src/services/CrashReporting/CrashReporting.ts';
installCrashReporting();
import { Loader } from './src/Loader.tsx';
const Root = () => (
<SafeAreaProvider style={{ flex: 1 }}>
<Loader />
</SafeAreaProvider>
);
AppRegistry.registerComponent(appName, () => Root);