Add a way to suppress DevTools logs and warnings (#11448)
Dan Abramov committed
Nov 4, 2017 at 00:21 UTC
8de8be07a89f55ebfcaaccf1499e03f22d90bad5
1 file changed
+6
packages/react-reconciler/src/ReactFiberDevToolsHook.js
+6
@@ -37,6 +37,12 @@ export function injectInternals(internals: Object): boolean {
37
return false;
38
}
39
const hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
40
+ if (hook.isDisabled) {
41
+ // This isn't a real property on the hook, but it can be set to opt out
42
+ // of DevTools integration and associated warnings and logs.
43
+ // https://github.com/facebook/react/issues/3877
44
+ return true;
45
+ }
46
if (!hook.supportsFiber) {
47
if (__DEV__) {
48
warning(