Skip to content

Migration Guide

Kemal Ahmed edited this page Jul 30, 2020 · 7 revisions

v0.x.x to v2.x.x

See the reason behind the update

1

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'

2

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",
  ...
  ]
};

.

3

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.

Clone this wiki locally