2022-06-09
2292
#react native
Chimezie Innocent
115257
Jun 9, 2022 ⋅ 8 min read

Understanding React Native env variables

Chimezie Innocent I am Chimezie, a software developer based in Nigeria. I am highly skilled in HTML, CSS, and JS to build web-accessible and progressive apps. I'm also skilled with React for web, React Native for Android apps, and Tailwind CSS. I write technical articles, too.

Recent posts:

Using Defer In Angular 17 To Implement Lazy Loading

Using defer in Angular 17 to implement lazy loading

Angular’s new `defer` feature, introduced in Angular 17, can help us optimize the delivery of our apps to end users.

Lewis Cianci
Dec 4, 2023 ⋅ 10 min read

Using ElectricSQL to build a local-first application

ElectricSQL is a cool piece of software with immense potential. It gives developers the ability to build a true local-first application.

Rahul Padalkar
Dec 1, 2023 ⋅ 11 min read
Using Rust And Leptos To Build Beautiful Declarative User Interfaces

Using Rust and Leptos to build beautiful, declarative UIs

Leptos is an amazing Rust web frontend framework that makes it easier to build scalable, performant apps with beautiful, declarative UIs.

Eze Sunday
Nov 30, 2023 ⋅ 10 min read
5 Best JavaScript Multi-Dimensional Array Libraries

5 best JavaScript multidimensional array libraries

Learn more about the 5 best JavaScript libraries for dealing with multidimensional arrays, such as ndarray, math.js, and NumJs.

Pascal Akunne
Nov 30, 2023 ⋅ 4 min read
View all posts

One Reply to "Understanding React Native env variables"

  1. I followed the same steps, but i am getting this error: Unable to resolve “@env” from “App.tsx”

    Here is my babel.config.js:
    module.exports = function (api) {
    api.cache(true);
    return {
    presets: [“babel-preset-expo”],
    env: {
    production: {
    plugins: [“react-native-paper/babel”],
    },
    },
    plugins: [
    [
    “module:react-native-dotenv”,
    {
    envName: “APP_ENV”,
    moduleName: “@env”,
    path: “.env”,
    allowUndefined: true,
    },
    ],
    ],
    };
    };

    Not sure what is going wrong here, i tried adding a env.d.ts type declarations as well, but didn’t work. I am using react-native with Expo + typescript.

Leave a Reply