January 24, 2021
You often want to show the version number of your app to the user.
In an Expo (React Native) app, you can do this using the
expo-constants package, provided by Expo.
First, install the package:
expo install expo-constants
Then, add the package to the file where you want to get the version number:
import Constants from "expo-constants"
Now, you can access
Constants.manifest, which is the current "manifest" (
app.json file) of your app. The version number is available like this:
const version = Constants.manifest.version
A quick favor: was anything I wrote incorrect or misspelled, or do you still have questions? Please use this form to let me know or ask for help!