GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Improved dev experience when DevTools hook is disabled (#20208) · react/react@9aca239

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-refresh/src
    • ReactFreshRuntime.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-refresh/src/ReactFreshRuntime.js‎

Copy file name to clipboardExpand all lines: packages/react-refresh/src/ReactFreshRuntime.js
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,17 @@ export function injectIntoGlobalHook(globalObject: any): void {
465465
};
466466
}
467467

468+
if (hook.isDisabled) {
469+
// This isn't a real property on the hook, but it can be set to opt out
470+
// of DevTools integration and associated warnings and logs.
471+
// Using console['warn'] to evade Babel and ESLint
472+
console['warn'](
473+
'Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). ' +
474+
'Fast Refresh is not compatible with this shim and will be disabled.',
475+
);
476+
return;
477+
}
478+
468479
// Here, we just want to get a reference to scheduleRefresh.
469480
const oldInject = hook.inject;
470481
hook.inject = function(injected) {

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.