We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 683afc3 commit fad96ebCopy full SHA for fad96eb
package/src/utils/getReactNativeVersion.ts
@@ -1,11 +1,6 @@
1
-import ReactNativePackageJSON from 'react-native/package.json';
+import { Platform } from 'react-native';
2
3
export const getReactNativeVersion = () => {
4
- const version = ReactNativePackageJSON.version;
5
- const [major, minor, patch] = version.split('.');
6
- return {
7
- major: Number(major),
8
- minor: Number(minor),
9
- patch: Number(patch),
10
- };
+ const version = Platform.constants.reactNativeVersion;
+ return version;
11
};
0 commit comments