Using environment file (.env) to configure most critical variables like database credentials, api keys, is the most common practice in software dev...
For further actions, you may consider blocking this person and/or reporting abuse
Thank you. This was helpful.
@wilmela , Glad to hear that!
You are a hero man, this literally save my project. I want one day to be able to make posts this useful
Danko . this was helpful.
Thank you.. This was helpful.
worked perfectly
Thanks u. U are my hero in my heart
Great one Dallington 🙂
Any reason why you didn't install
react-native-dotenvasdevDependencies...? I'd recommend to do so.Thank you
Worked fine! But error in typescript import: Cannot find module '@env' or its corresponding type
@abdulmegadraws, to resolve error in typescript import: Cannot find module '@env' or its corresponding type, create env.d.ts file in your project root directory and define module '@env' for example;
declare module '@env' {
export const API_URL: string;
export const MAJOR_VERSION: string;
export const MINOR_VERSION: string;
export const PATCH_VERSION: string;
}
What to do if the '@env' is not found despite following each steps?
@marcoottina, do you get this error when using typescript?