Skip to content

Commit fc0f9c0

Browse files
gaearonLeonYuAng3NT
authored andcommitted
Use "Component" as fallback name in more places (facebook#12430)
1 parent b0ac7d7 commit fc0f9c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/react-reconciler/src/ReactFiberClassComponent.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export default function(
233233
const instance = workInProgress.stateNode;
234234
const type = workInProgress.type;
235235
if (__DEV__) {
236-
const name = getComponentName(workInProgress);
236+
const name = getComponentName(workInProgress) || 'Component';
237237
const renderPresent = instance.render;
238238

239239
if (!renderPresent) {
@@ -423,7 +423,7 @@ export default function(
423423
typeof ctor.getDerivedStateFromProps === 'function' &&
424424
state === null
425425
) {
426-
const componentName = getComponentName(workInProgress) || 'Unknown';
426+
const componentName = getComponentName(workInProgress) || 'Component';
427427
if (!didWarnAboutUninitializedState[componentName]) {
428428
warning(
429429
false,
@@ -575,7 +575,7 @@ export default function(
575575

576576
if (__DEV__) {
577577
if (partialState === undefined) {
578-
const componentName = getComponentName(workInProgress) || 'Unknown';
578+
const componentName = getComponentName(workInProgress) || 'Component';
579579
if (!didWarnAboutUndefinedDerivedState[componentName]) {
580580
warning(
581581
false,

0 commit comments

Comments
 (0)