React Native trouble shooting for iOS and Android
When building native apps using react native one runs into many peculiarities, here I list things I come across...
When building native apps using react native one runs into many peculiarities, here I list things I come across...
Add support for using .env in your project using: https://www.npmjs.com/package/react-native-config
Make sure you do the step "Extra step for Android": https://github.com/lugg/react-native-config?tab=readme-ov-file#extra-step-for-android
If on iOS it's not working, run pod install
inside ios
folder.
You can also use variables to refer to your .env variables like this:
import Config from "react-native-config";
const ENV = 'STAGE'; // 'LOCAL' or 'PROD' or 'STAGE'
export const SHOP_URL = Config[`SHOP_URL_${ENV}`];
Learning React Native
Instructions for developing native apps on mac using React Native...