Determine if in production or development environment

Hi,

What is the recommended way to determine in my code if I’m running in development or production environment?

thanks

You have the __DEV__ global variable, so things like:

if (__DEV__) {
  console.log('123');
}

work fine

3 Likes