Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you detect development mode in Expo?

You can turn development mode on and off in the expo XDE, but how do you detect it in your code so you can switch on debug logging or do something differently for the debug build? Their docs show how to enable it, and see it in the UI, but not how to test for it in code.

like image 848
boatcoder Avatar asked Oct 20 '17 02:10

boatcoder


People also ask

How do I open the Developer menu in Expo?

Showing the Developer Menu Terminal UI: Press M in the terminal to open the menu on connected iOS and Android. iOS Device: Shake the device a little bit. iOS Simulator: Hit Ctrl + Cmd ⌘ + Z on a Mac in the emulator to simulate the shake gesture, or press Cmd ⌘ + D .

What is Expo development client?

expo-dev-client is designed to support any workflow, release process, or set of dependencies in the Expo/React Native ecosystem.

What is Expo app development?

Expo is a framework to build React Native apps. It is a set with tools and services built for React Native. It will help you begin with building React Native apps with ease. It provides you with a list of tools that simplify the creation and testing of React Native app.

How do I know what version of Expo I have?

You can check your Node version by running the Node -v command on your terminal. Expo offers a command-line interface called Expo CLI. It is used to test the app while it's being developed either in iOS or Android.


1 Answers

This always works for me. No need to look in the packagerOpts.

if (__DEV__) {
  // do dev stuff 🤘
}
like image 177
GollyJer Avatar answered Oct 05 '22 22:10

GollyJer