Skip to content

Commit 8eb27a1

Browse files
committed
patchConsoleForInitialRenderInStrictMode-> patchConsoleForInitialCommitInStrictMode
1 parent ed7a2b2 commit 8eb27a1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Diff for: packages/react-devtools-shared/src/backend/console.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ export function unpatch(): void {
294294

295295
let unpatchForStrictModeFn: null | (() => void) = null;
296296

297-
// NOTE: KEEP IN SYNC with src/hook.js:patchConsoleForInitialRenderInStrictMode
297+
// NOTE: KEEP IN SYNC with src/hook.js:patchConsoleForInitialCommitInStrictMode
298298
export function patchForStrictMode() {
299299
if (consoleManagedByDevToolsDuringStrictMode) {
300300
const overrideConsoleMethods = [
@@ -359,7 +359,7 @@ export function patchForStrictMode() {
359359
}
360360
}
361361

362-
// NOTE: KEEP IN SYNC with src/hook.js:unpatchConsoleForInitialRenderInStrictMode
362+
// NOTE: KEEP IN SYNC with src/hook.js:unpatchConsoleForInitialCommitInStrictMode
363363
export function unpatchForStrictMode(): void {
364364
if (consoleManagedByDevToolsDuringStrictMode) {
365365
if (unpatchForStrictModeFn !== null) {

Diff for: packages/react-devtools-shared/src/hook.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export function installHook(target: any): DevToolsHook | null {
225225
// React and DevTools are connecting and the renderer interface isn't avaiable
226226
// and we want to be able to have consistent logging behavior for double logs
227227
// during the initial renderer.
228-
function patchConsoleForInitialRenderInStrictMode({
228+
function patchConsoleForInitialCommitInStrictMode({
229229
hideConsoleLogsInStrictMode,
230230
browserTheme,
231231
}: {
@@ -311,7 +311,7 @@ export function installHook(target: any): DevToolsHook | null {
311311
}
312312

313313
// NOTE: KEEP IN SYNC with src/backend/console.js:unpatchForStrictMode
314-
function unpatchConsoleForInitialRenderInStrictMode() {
314+
function unpatchConsoleForInitialCommitInStrictMode() {
315315
if (unpatchFn !== null) {
316316
unpatchFn();
317317
unpatchFn = null;
@@ -451,19 +451,19 @@ export function installHook(target: any): DevToolsHook | null {
451451
rendererInterface.unpatchConsoleForStrictMode();
452452
}
453453
} else {
454-
// This should only happen during initial render in the extension before DevTools
454+
// This should only happen during initial commit in the extension before DevTools
455455
// finishes its handshake with the injected renderer
456456
if (isStrictMode) {
457457
const hideConsoleLogsInStrictMode =
458458
window.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__ === true;
459459
const browserTheme = window.__REACT_DEVTOOLS_BROWSER_THEME__;
460460

461-
patchConsoleForInitialRenderInStrictMode({
461+
patchConsoleForInitialCommitInStrictMode({
462462
hideConsoleLogsInStrictMode,
463463
browserTheme,
464464
});
465465
} else {
466-
unpatchConsoleForInitialRenderInStrictMode();
466+
unpatchConsoleForInitialCommitInStrictMode();
467467
}
468468
}
469469
}

0 commit comments

Comments
 (0)