Skip to content

Commit 2fda791

Browse files
authored
Add prerelease info to version in about example (#8388)
## Summary This PR adds the prerelease tag to the React Native version shown in "About" example. ## Test plan
1 parent 320c2e8 commit 2fda791

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/common-app/src/apps/reanimated/examples/AboutExample.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,24 @@ function getBundle() {
2525

2626
function getRuntime() {
2727
if ('HermesInternal' in global) {
28+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
2829
const version =
2930
// @ts-ignore this is fine
31+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
3032
global.HermesInternal?.getRuntimeProperties?.()['OSS Release Version'];
3133
return `Hermes (${version})`;
3234
}
33-
return 'JSC';
35+
return 'unknown';
3436
}
3537

3638
function getArchitecture() {
3739
return 'nativeFabricUIManager' in global ? 'Fabric' : 'Paper';
3840
}
3941

4042
function getReactNativeVersion() {
41-
const { major, minor, patch } = Platform.constants.reactNativeVersion;
42-
return `${major}.${minor}.${patch}`;
43+
const { major, minor, patch, prerelease } =
44+
Platform.constants.reactNativeVersion;
45+
return `${major}.${minor}.${patch}${prerelease ? `-${prerelease}` : ''}`;
4346
}
4447

4548
export default function AboutExample() {

0 commit comments

Comments
 (0)