8616212e61
Add support for react-native-windows. Update the docs and example and add an automatic CI test. |
||
---|---|---|
.. | ||
__tests__ | ||
android | ||
ios | ||
jest-setups | ||
windows | ||
.buckconfig | ||
.env | ||
.env.production | ||
.eslintrc.js | ||
.flowconfig | ||
.gitattributes | ||
.gitignore | ||
.prettierrc.js | ||
.watchmanconfig | ||
App.js | ||
README.md | ||
app.json | ||
babel.config.js | ||
index.js | ||
metro.config.js | ||
package.json | ||
yarn.lock |
README.md
Example app using react-native-config
Just a simple app accessing config variables from .env
and .env.production
.
Running
By default it will read variables from .env
:
$ react-native run-android
To read from another file just specify it with ENVFILE
, like:
$ ENVFILE=.env.prod react-native run-android
Running on Windows
To use the default .env
file:
npx react-native run-windows
To read from another file:
set ENVFILE=.env.production
npx react-native run-windows
Running from Xcode
Open the Xcode project file in Example/ios/Example.xcodeproj
.
Notice there are two schemes setup for the application: "Example" runs the default build, reading vars from .env
– and "Example (production)" is configured to read from .env.production
.