Skip to content

Commit 0224613

Browse files
committed
Delete early patching registerRendererWithConsole
This doesn't inject onErrorAndWarning and getComponentStack so it doesn't really do anything useful anyway.
1 parent 1c3825f commit 0224613

File tree

1 file changed

+0
-19
lines changed
  • packages/react-devtools-shared/src

1 file changed

+0
-19
lines changed

packages/react-devtools-shared/src/hook.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -367,25 +367,6 @@ export function installHook(target: any): DevToolsHook | null {
367367
? 'deadcode'
368368
: detectReactBuildType(renderer);
369369

370-
// Patching the console enables DevTools to do a few useful things:
371-
// * Append component stacks to warnings and error messages
372-
// * Disabling or marking logs during a double render in Strict Mode
373-
// * Disable logging during re-renders to inspect hooks (see inspectHooksOfFiber)
374-
//
375-
// Allow patching console early (during injection) to
376-
// provide developers with components stacks even if they don't run DevTools.
377-
if (target.hasOwnProperty('__REACT_DEVTOOLS_CONSOLE_FUNCTIONS__')) {
378-
const {registerRendererWithConsole, patchConsoleUsingWindowValues} =
379-
target.__REACT_DEVTOOLS_CONSOLE_FUNCTIONS__;
380-
if (
381-
typeof registerRendererWithConsole === 'function' &&
382-
typeof patchConsoleUsingWindowValues === 'function'
383-
) {
384-
registerRendererWithConsole(renderer);
385-
patchConsoleUsingWindowValues();
386-
}
387-
}
388-
389370
// If we have just reloaded to profile, we need to inject the renderer interface before the app loads.
390371
// Otherwise the renderer won't yet exist and we can skip this step.
391372
const attach = target.__REACT_DEVTOOLS_ATTACH__;

0 commit comments

Comments
 (0)