Skip to content
Kemal Ahmed edited this page Feb 13, 2024 · 55 revisions

Welcome to the react-native-dotenv wiki!

Docs TODOs

  • make sure to add metro (I dont remember why)
module.exports = {
  "presets": ["module:metro-react-native-babel-preset"],
  "plugins": [
    ["module:react-native-dotenv"]
  ]
}
  • for typescript, set moduleName to react-native-dotenv, clear cache
  • jest --no-cache
  • encourage people to use NODE_ENV instead of APP_ENV
  • add windows instructions for APP_ENV=
  • is there a way to automatically install as babel plugin not preset?
  • is there a way to automatically install as devDependency not regular dependency?
  • --env-file=.env
  • react-native clean
  • don't use APP_ENV unless you've first tried NODE_ENV
  • this won't work when you do react-native run-android or react-native run-ios, but it's okay because you just need to run the command once to do the initial build. After that point, you should be able to build changes using react-native start where this will work
module.exports = function(api) {
api.cache(false)
}

Publishing

Version bump

Clone this wiki locally