diff --git a/packages/react-client/src/ReactClientConsoleConfigBrowser.js b/packages/react-client/src/ReactClientConsoleConfigBrowser.js index a8a375debdc59..a80a410d28d90 100644 --- a/packages/react-client/src/ReactClientConsoleConfigBrowser.js +++ b/packages/react-client/src/ReactClientConsoleConfigBrowser.js @@ -65,9 +65,9 @@ export function printToConsole( ); } - if (methodName === 'error') { + if (methodName === 'error' && __DEV__) { error.apply(console, newArgs); - } else if (methodName === 'warn') { + } else if (methodName === 'warn' && __DEV__) { warn.apply(console, newArgs); } else { // $FlowFixMe[invalid-computed-prop] diff --git a/packages/react-client/src/ReactClientConsoleConfigPlain.js b/packages/react-client/src/ReactClientConsoleConfigPlain.js index 64b61d6ed6f76..45069ea7bd087 100644 --- a/packages/react-client/src/ReactClientConsoleConfigPlain.js +++ b/packages/react-client/src/ReactClientConsoleConfigPlain.js @@ -46,9 +46,9 @@ export function printToConsole( newArgs.splice(offset, 0, badgeFormat, pad + badgeName + pad); } - if (methodName === 'error') { + if (methodName === 'error' && __DEV__) { error.apply(console, newArgs); - } else if (methodName === 'warn') { + } else if (methodName === 'warn' && __DEV__) { warn.apply(console, newArgs); } else { // $FlowFixMe[invalid-computed-prop] diff --git a/packages/react-client/src/ReactClientConsoleConfigServer.js b/packages/react-client/src/ReactClientConsoleConfigServer.js index 0a62707cf6494..8ae8152a08809 100644 --- a/packages/react-client/src/ReactClientConsoleConfigServer.js +++ b/packages/react-client/src/ReactClientConsoleConfigServer.js @@ -66,9 +66,9 @@ export function printToConsole( ); } - if (methodName === 'error') { + if (methodName === 'error' && __DEV__) { error.apply(console, newArgs); - } else if (methodName === 'warn') { + } else if (methodName === 'warn' && __DEV__) { warn.apply(console, newArgs); } else { // $FlowFixMe[invalid-computed-prop]