1

In my app I have to use different API endpoints depending on the type of build. Up till now I was always changing the api variable manually before each build, but now I wan't to see if this can be automated. Has anyone come up with a simple solution to this? I imagine this to be a check when the app is bundling, and if say the build is 'release', the api variable should be X.

1

1 Answer 1

0

Not sure if it's a good idea but you can use __DEV__ global variable in JavaScript to determine if you're using React Native packager or not

const randomVar = __DEV__ ? 'devValue' : 'releaseVal';
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.