Is there any way to get react-native`s version through javascript code? Something like this
import {
Platform
} from 'react-native';
let version = Platform.version;
These code can do the trick.
const PACKAGE = require('YOUR_PROJECT_PATH/node_modules/react-native/package.json');
const version = PACKAGE.version;
There is another way to do the same thing.
const ReactNativeVersion = require('./node_modules/react-native/Libraries/Core/ReactNativeVersion');
console.log(ReactNativeVersion.version.major + ReactNativeVersion.version.minor);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With