Skip to content

Commit

Permalink
Add a way to suppress DevTools logs and warnings (facebook#11448)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored and Ethan-Arrowood committed Dec 8, 2017
1 parent 62cfb4d commit 0d244b4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/react-reconciler/src/ReactFiberDevToolsHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 0d244b4

Please sign in to comment.