Setting environment variable in react-native | React Native | .env variables

preview_player
Показать описание
Many modern-day applications now go through different stages of the product cycle such as development, staging, production etc.

Having different environment variables for each environment will make it a lot easier to manage any application. This article is intended to share one solution to address this problem in React Native. We will be using a library called react-native-config for this purpose; you can also try react-native-dotenv.

We will be focusing on having three different bundles containing configuration files for development, staging and production environments.

yarn add react-native-config

Build staging

Build prod

Release staging

Release production

#reactnative #env #android #env

#tags
Рекомендации по теме
Комментарии
Автор

Thanks a lot it is very useful. but can we get the second part of this tutorial?

arshiyanaz
Автор

How to change env at run time? Is there a way?

paadaghattam