Should you remove the console.log()
calls before deploying a React Native app to the stores? Are there some performance or other issues that exist if the console.log()
calls are kept in the code?
Is there a way to remove the logs with some task runner (in a similar fashion to web-related task runners like Grunt or Gulp)? We still want them during our development/debugging/testing phase but not on production.
Thanks!
Well, you can always do something like:
if (!__DEV__) {
console.log = () => {};
}
So every console.log
would be invalidated as soon as __DEV__
is not true.