Add a way to suppress DevTools logs and warnings (#11448)

This commit is contained in:
Dan Abramov
2017-11-04 00:21:12 +00:00
committed by GitHub
parent bfa269008a
commit 8de8be07a8

View File

@@ -37,6 +37,12 @@ export function injectInternals(internals: Object): boolean {
return false;
}
const hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (hook.isDisabled) {
// This isn't a real property on the hook, but it can be set to opt out
// of DevTools integration and associated warnings and logs.
// https://github.com/facebook/react/issues/3877
return true;
}
if (!hook.supportsFiber) {
if (__DEV__) {
warning(