【发布时间】:2021-09-14 10:17:36
【问题描述】:
Unable to resolve module @env from D:\react\weatho\weatho-app\App.js: @env could not be found within the project
10:import {REACT_APP_WEATHER_API_KEY} from "@env";
我的 env 文件如下所示:
REACT_APP_WEATHER_API_KEY=2607fb610e6f9fecd16c84408d0b42a2
我的 Babel 文件如下所示:
module.exports = function(api) {
api.cache(true);
return {
plugin: ['babel-preset-expo','module:react-native-dotenv'],
}
}
我的 env 文件与 Appjson 和其他一些文件一起位于根文件夹中
【问题讨论】:
标签: reactjs environment-variables native