Skip to content

Commit 0d244b4

Browse files
gaearonEthan-Arrowood
authored andcommitted
Add a way to suppress DevTools logs and warnings (facebook#11448)
1 parent 62cfb4d commit 0d244b4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: packages/react-reconciler/src/ReactFiberDevToolsHook.js

+6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ export function injectInternals(internals: Object): boolean {
3737
return false;
3838
}
3939
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+
}
4046
if (!hook.supportsFiber) {
4147
if (__DEV__) {
4248
warning(

0 commit comments

Comments
 (0)