Handling different environments
根據環境(pro、stage、dev...)而配置環境參數
Last updated
根據環境(pro、stage、dev...)而配置環境參數
Last updated
API_URL=https://myapi.com
GOOGLE_MAPS_API_KEY=abcdefghimport Config from 'react-native-config'
Config.API_URL // 'https://myapi.com'
Config.GOOGLE_MAPS_API_KEY // 'abcdefgh'$ ENVFILE=.env.staging react-native run-ios # bash
$ SET ENVFILE='.env.staging' && react-native run-ios # windows
$ env:ENVFILE=".env.staging"; react-native run-ios # powershell