Skip to content

Commit 4937155

Browse files
authored
Actually disable Fast Refresh
1 parent a581a3b commit 4937155

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/react-refresh/src/ReactFreshRuntime.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,13 +464,18 @@ export function injectIntoGlobalHook(globalObject: any): void {
464464
onCommitFiberUnmount() {},
465465
};
466466
}
467-
// Checks if DevTools hook is disabled
467+
468468
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
469472
console['warn'](
470473
'Something has shimmed the React DevTools global hook (REACT_DEVTOOLS_GLOBAL_HOOK). ' +
471474
'Fast Refresh is not compatible with this shim and will be disabled.',
472475
);
476+
return;
473477
}
478+
474479
// Here, we just want to get a reference to scheduleRefresh.
475480
const oldInject = hook.inject;
476481
hook.inject = function(injected) {

0 commit comments

Comments
 (0)