How do you determine the development mode in Expo?

You can turn development mode on and off in XDE, but how do you find it in your code so you can turn on debug logging or do something different to build debugging? Their docs show how to enable it, and see it in the user interface, but not how to check it in code.

+9
source share
2 answers

My last question was answered let isDev = packagerOpts && packagerOpts.dev, which is located inConstants.manifest

https://forums.expo.io/t/constants-manifest-packageropts-dev-is-undefined/10890/5

+1
source

It always works for me. No need to search in packagerOpts.

if (__DEV__) {
  // do dev stuff 🤘
}
+1
source

Source: https://habr.com/ru/post/1687845/


All Articles