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

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ม.ค. 2022
  • 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-staging":"cp ./.env.staging ./.env && npx react-native run-android"
    Build prod
    "build-prod":"cp ./env.prod ./.env && npx react-native run-android"
    Release staging
    "release-staging":"cd android && ENVFILE=.env.staging ./gradlew assembleRelease"
    Release production
    "release-prod":"cd android && ENVFILE=.env.prod ./gradlew assembleRelease"
    www.npmjs.com/package/react-n...
    #reactnative #env #android #env
    #tags
    expo react native,react native,react native app,react native video,expo react native tutorial,react native tutorial,react native vs flutter,react native navigation,react navigation,react native crash coures,react native from scratch,react native carousel slider,react .env example,react js best practices,reactjs basics,react .env file,react native tutorial for beginners,react .env.local,react environment variables,bitfumes react js,reactjs best,multiple environments,multi environment,react native,environment,react native tutorials 2022,production,states,android,targets,development,app development,kotlin,staging,javascript,redux toolkit,java,hooks,tutorial,flavours,ios,
    environmentvariable,environment variable,expo react native,react native,expo react native tutorial,reactnative,react native app,react native video,environment,react native tutorial,react native vs flutter,react native navigation,react native from scratch,react native crash coures,react navigation,react native carousel slider,react-native,variables,react native tutorial for beginners,react native tutorial for beginners in hindi,app development,web development,multiple environments,react native,multi environment,react native tutorials 2022,environment,states,production,development,app development,kotlin,targets,staging,javascript,redux toolkit,java,tutorial,flavours,ios,redux,swift,android,bitfumes react js,learn react,react js,reactjs,create react app,environments,react js course,environment variables,reactjs best,env variables,reactjs basics,react js course 2020,react js crash course,create-react-app,react js best projects,react,secret keys,react js best practices,what is virtual dom,react tutorial,firebase,reactjs tutorial 2020,react .env file,reactjs basic concepts,react js course for beginners,react .env.local,react .env file,react .env example,.env file,react .env.local,react environment variables,react environment setup,react js environment variables,react js mini,react js tutorial,how to create .env file in react js,react js best practices,react js,reactjs best,react,env variables,react js course for beginners,react js best projects,react js tutorials,reactjs basics,how to use .env file in reactjs,react js course,react js course 2020,reactjs,env variables,environment variables,reactjs,javascript tutorial,tutorial,create react app,secret keys,react,environments,web development,javascript,stripe,frontend,firebase,front-end,production,env,env-cmd,web dev,cra,api,keys,staging,api keys,how to add env,react native navigation,react native tutorial for beginners in hindi,react native tutorial,react native vs flutter,react native app,react native carousel slider,react native crash coures,react native from scratch,react native video,expo react native tutorial,react native tutorial for beginners,react navigation,react native,expo react native,environmentvariable,time management,tutorials,react hooks,development,social meda,carousel view,resume writing,expo react native,react native,reactnative,react native app,react native video,expo react native tutorial,react native tutorial,react-native,react navigation,react native navigation,react native vs flutter,react native from scratch,react native crash coures,react native carousel slider,react native tutorial for beginners,react,react hooks,react native tutorial for beginners in hindi,react js,environmentvariable,environment variable,mern stack,.env

ความคิดเห็น • 11

  • @narekmusakhanyan523
    @narekmusakhanyan523 2 ปีที่แล้ว +1

    Thank you sir

    • @JASACADAMY
      @JASACADAMY  2 ปีที่แล้ว

      thanks for feedback 👍 please subscribe

  • @arshiyanaz2675
    @arshiyanaz2675 2 ปีที่แล้ว +2

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

    • @JASACADAMY
      @JASACADAMY  2 ปีที่แล้ว +1

      sure.we will upload it soon

    • @arshiyanaz2675
      @arshiyanaz2675 2 ปีที่แล้ว

      @@JASACADAMY waiting.....just curious how long it will take for next video?

  • @devanshsharma2723
    @devanshsharma2723 2 ปีที่แล้ว +1

    Is the next part uploaded?

    • @JASACADAMY
      @JASACADAMY  2 ปีที่แล้ว +1

      not yet will do

  • @paadaghattam
    @paadaghattam 4 หลายเดือนก่อน +1

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

    • @Simarspeaks8794
      @Simarspeaks8794 4 หลายเดือนก่อน

      You have to add script in package.json file

    • @JASACADAMY
      @JASACADAMY  3 หลายเดือนก่อน +1

      No