-
-
Notifications
You must be signed in to change notification settings - Fork 48
Migration Guide
Kemal Ahmed edited this page Jul 30, 2020
·
7 revisions
See the reason behind the update
Rename the import from 'react-native-dotenv' to '@env':
Before:
import {API_URL, API_TOKEN} from 'react-native-dotenv'
After:
import {API_URL, API_TOKEN} from '@env'
Make sure to add module:react-native-dotenv
to the list of babel plugins from the list of presets
module.exports = {
presets: ["module:metro-react-native-babel-preset"],
plugins: [
"module:react-native-dotenv",
...
]
};
.
If you are also using babel-plugin-dotenv-import
, make sure you pick one or the other as this repo is a fork of that repo.