process.env.NODE_ENV is flaky

i’m using process.env.NODE_ENV is my code to determine config settings.

i.e. if process.env.NODE_ENV == 'production' then it should use a certain set of configs.

In the standalone app on android this looks kind of flaky (not sure about ios yet). By flaky i mean that the app will start and report it is in dev mode.
If i dismiss the app and start it again it will switch to production.

is there a known issue around this? Is there a better recommended way for me to tell if the app is in production mode?

Hi @wexpo! We recommend using the __DEV__ global instead of process.env.NODE_ENV.

ok so __DEV__ will be true if it is development mode?

Yes that is correct!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.