1111import { getCurrentFiberOwnerNameInDevOrNull } from 'react-reconciler/src/ReactCurrentFiber' ;
1212import { registrationNameModules } from 'legacy-events/EventPluginRegistry' ;
1313import { canUseDOM } from 'shared/ExecutionEnvironment' ;
14- import warning from 'shared/warning' ;
1514import endsWith from 'shared/endsWith' ;
1615import { setListenToResponderEventTypes } from '../events/DOMEventResponderSystem' ;
1716
@@ -183,7 +182,7 @@ if (__DEV__) {
183182 return ;
184183 }
185184 didWarnInvalidHydration = true ;
186- warning (
185+ console . error (
187186 'Text content did not match. Server: "%s" Client: "%s"' ,
188187 normalizedServerText ,
189188 normalizedClientText ,
@@ -208,7 +207,7 @@ if (__DEV__) {
208207 return ;
209208 }
210209 didWarnInvalidHydration = true ;
211- warning (
210+ console . error (
212211 'Prop `%s` did not match. Server: %s Client: %s' ,
213212 propName ,
214213 JSON . stringify ( normalizedServerValue ) ,
@@ -225,12 +224,12 @@ if (__DEV__) {
225224 attributeNames . forEach ( function ( name ) {
226225 names . push ( name ) ;
227226 } ) ;
228- warning ( 'Extra attributes from the server: %s' , names ) ;
227+ console . error ( 'Extra attributes from the server: %s' , names ) ;
229228 } ;
230229
231230 warnForInvalidEventListener = function ( registrationName , listener ) {
232231 if ( listener === false ) {
233- warning (
232+ console . error (
234233 'Expected `%s` listener to be a function, instead got `false`.\n\n' +
235234 'If you used to conditionally omit it with %s={condition && value}, ' +
236235 'pass %s={condition ? value : undefined} instead.' ,
@@ -239,7 +238,7 @@ if (__DEV__) {
239238 registrationName ,
240239 ) ;
241240 } else {
242- warning (
241+ console . error (
243242 'Expected `%s` listener to be a function, instead got a value of `%s` type.' ,
244243 registrationName ,
245244 typeof listener ,
@@ -412,7 +411,7 @@ export function createElement(
412411 // Should this check be gated by parent namespace? Not sure we want to
413412 // allow <SVG> or <mATH>.
414413 if ( ! isCustomComponentTag && type !== type . toLowerCase ( ) ) {
415- warning (
414+ console . error (
416415 '<%s /> is using incorrect casing. ' +
417416 'Use PascalCase for React components, ' +
418417 'or lowercase for HTML elements.' ,
@@ -427,7 +426,7 @@ export function createElement(
427426 const div = ownerDocument . createElement ( 'div' ) ;
428427 if ( __DEV__ ) {
429428 if ( enableTrustedTypesIntegration && ! didWarnScriptTags ) {
430- warning (
429+ console . error (
431430 'Encountered a script tag while rendering React component. ' +
432431 'Scripts inside React components are never executed when rendering ' +
433432 'on the client. Consider using template tag instead ' +
@@ -482,7 +481,7 @@ export function createElement(
482481 ! Object . prototype . hasOwnProperty . call ( warnedUnknownTags , type )
483482 ) {
484483 warnedUnknownTags [ type ] = true ;
485- warning (
484+ console . error (
486485 'The tag <%s> is unrecognized in this browser. ' +
487486 'If you meant to render a React component, start its name with ' +
488487 'an uppercase letter.' ,
@@ -518,7 +517,7 @@ export function setInitialProperties(
518517 ! didWarnShadyDOM &&
519518 ( domElement : any ) . shadyRoot
520519 ) {
521- warning (
520+ console . error (
522521 '%s is using shady DOM. Using shady DOM with React can ' +
523522 'cause things to break subtly.' ,
524523 getCurrentFiberOwnerNameInDevOrNull ( ) || 'A component' ,
@@ -918,7 +917,7 @@ export function diffHydratedProperties(
918917 ! didWarnShadyDOM &&
919918 ( domElement : any ) . shadyRoot
920919 ) {
921- warning (
920+ console . error (
922921 '%s is using shady DOM. Using shady DOM with React can ' +
923922 'cause things to break subtly.' ,
924923 getCurrentFiberOwnerNameInDevOrNull ( ) || 'A component' ,
@@ -1210,7 +1209,7 @@ export function warnForDeletedHydratableElement(
12101209 return ;
12111210 }
12121211 didWarnInvalidHydration = true ;
1213- warning (
1212+ console . error (
12141213 'Did not expect server HTML to contain a <%s> in <%s>.' ,
12151214 child . nodeName . toLowerCase ( ) ,
12161215 parentNode . nodeName . toLowerCase ( ) ,
@@ -1227,7 +1226,7 @@ export function warnForDeletedHydratableText(
12271226 return ;
12281227 }
12291228 didWarnInvalidHydration = true ;
1230- warning (
1229+ console . error (
12311230 'Did not expect server HTML to contain the text node "%s" in <%s>.' ,
12321231 child . nodeValue ,
12331232 parentNode . nodeName . toLowerCase ( ) ,
@@ -1245,7 +1244,7 @@ export function warnForInsertedHydratedElement(
12451244 return ;
12461245 }
12471246 didWarnInvalidHydration = true ;
1248- warning (
1247+ console . error (
12491248 'Expected server HTML to contain a matching <%s> in <%s>.' ,
12501249 tag ,
12511250 parentNode . nodeName . toLowerCase ( ) ,
@@ -1269,7 +1268,7 @@ export function warnForInsertedHydratedText(
12691268 return ;
12701269 }
12711270 didWarnInvalidHydration = true ;
1272- warning (
1271+ console . error (
12731272 'Expected server HTML to contain a matching text node for "%s" in <%s>.' ,
12741273 text ,
12751274 parentNode . nodeName . toLowerCase ( ) ,
0 commit comments