Disable chrome react DevTools for production

前端 未结 5 670
[愿得一人]
[愿得一人] 2020-12-09 10:06

I\'m trying to browserify my react app for production using gulp and envify to setup NODE_ENV. So I can remove react warning, error reporting in the console, and even my cod

5条回答
  •  感动是毒
    2020-12-09 10:54

    Just improve @peteriod answer, to make sure Dev tool has installed or not

    if (typeof window.__REACT_DEVTOOLS_GLOBAL_HOOK__ === 'object') {
       __REACT_DEVTOOLS_GLOBAL_HOOK__.inject = function() {};
    }
    

提交回复
热议问题