/
App.tsx
33 lines (29 loc) · 974 Bytes
/
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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* Generated with the TypeScript template
* https://github.com/react-native-community/react-native-template-typescript
*
* @format
*/
import React, { Component } from 'react';
import { Text, TextStyle, View, Platform } from 'react-native';
import { MainPage } from './MainPage';
const otherEngine = Platform.OS === 'android' || Platform.OS === 'ios' ? 'JavaScriptCore' : 'non-Hermes (Chakra or V8)';
const hermesVersion = global.HermesInternal?.getRuntimeProperties?.()['OSS Release Version'] ?? '';
const engineText = hermesVersion ? `Engine: Hermes ${hermesVersion}` : `Engine: ${otherEngine}`;
export default class App extends Component {
public override render(): JSX.Element {
const engineTextStyle: TextStyle = {
textAlign: 'right',
paddingHorizontal: 4,
};
return (
<View>
<Text style={engineTextStyle}>{engineText}</Text>
<MainPage />
</View>
);
}
}