Restore DevTools console message (#21864)

This commit is contained in:
Dan Abramov 2021-07-13 15:41:51 +01:00 committed by GitHub
parent a4ecd85e86
commit 9f5224a9c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -69,8 +69,13 @@ export function injectInternals(internals: Object): boolean {
console.error('React instrumentation encountered an error: %s.', err);
}
}
// DevTools exists
if (hook.checkDCE) {
// This is the real DevTools.
return true;
} else {
// This is likely a hook installed by Fast Refresh runtime.
return false;
}
}
export function onScheduleRoot(root: FiberRoot, children: ReactNodeList) {

View File

@ -69,8 +69,13 @@ export function injectInternals(internals: Object): boolean {
console.error('React instrumentation encountered an error: %s.', err);
}
}
// DevTools exists
if (hook.checkDCE) {
// This is the real DevTools.
return true;
} else {
// This is likely a hook installed by Fast Refresh runtime.
return false;
}
}
export function onScheduleRoot(root: FiberRoot, children: ReactNodeList) {