Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/react-reconciler/src/ReactFiberDevToolsHook.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,13 @@ export function injectInternals(internals: Object): boolean {
console.error('React instrumentation encountered an error: %s.', err);
}
}
// DevTools exists
return true;
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) {
Expand Down
9 changes: 7 additions & 2 deletions packages/react-reconciler/src/ReactFiberDevToolsHook.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,13 @@ export function injectInternals(internals: Object): boolean {
console.error('React instrumentation encountered an error: %s.', err);
}
}
// DevTools exists
return true;
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) {
Expand Down