Add a way to suppress DevTools logs and warnings (#11448)
This commit is contained in:
parent
bfa269008a
commit
8de8be07a8
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue