Skip to content

Commit fad96eb

Browse files
committed
fix: deep import issue
1 parent 683afc3 commit fad96eb

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
import ReactNativePackageJSON from 'react-native/package.json';
1+
import { Platform } from 'react-native';
22

33
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-
};
4+
const version = Platform.constants.reactNativeVersion;
5+
return version;
116
};

0 commit comments

Comments
 (0)