-
Notifications
You must be signed in to change notification settings - Fork 0
Set up multiple environment with React Native (v0.71)
Do Tuan Hung edited this page Mar 7, 2023
·
1 revision
npx react-native init ProjectName
- Install React Native Config using
yarn add react-native-config
(if project is using yarn) - Go to build.gradle in android/app and paste this lines:
project.ext.envConfigFiles = [ developmentdebug: ".env.development", stagingdebug: ".env.staging", productiondebug: ".env.production", developmentrelease: ".env.development", productionrelease: ".env.production", stagingrelease: ".env.staging" ]
- Also:
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"