Getting version information at runtime in a React Native app

react-native-device-info library provides various device and application information, including the app version.
Install

1
npm install --save react-native-device-info

Sample usage:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import React from "react";
import { View, Text } from "react-native";
import DeviceInfo from "react-native-device-info";

const AppInfo = () => (
<View style={{ padding: 20 }}>
<Text style={{ fontSize: 8 }}>
Version: {DeviceInfo.getVersion()} Build Number:{" "}
{DeviceInfo.getBuildNumber()}
</Text>
</View>
);

export default AppInfo;