Use "Component" as fallback name in more places (#12430)
Dan Abramov committed
Mar 22, 2018 at 17:26 UTC
12687ff331e890391e936ad94873e6212d657b6a
1 file changed
+3
-3
packages/react-reconciler/src/ReactFiberClassComponent.js
+3
-3
@@ -233,7 +233,7 @@ export default function(
233
const instance = workInProgress.stateNode;
234
const type = workInProgress.type;
235
if (__DEV__) {
236
- const name = getComponentName(workInProgress);
236
+ const name = getComponentName(workInProgress) || 'Component';
237
const renderPresent = instance.render;
238
239
if (!renderPresent) {
@@ -423,7 +423,7 @@ export default function(
423
typeof ctor.getDerivedStateFromProps === 'function' &&
424
state === null
425
) {
426
- const componentName = getComponentName(workInProgress) || 'Unknown';
426
+ const componentName = getComponentName(workInProgress) || 'Component';
427
if (!didWarnAboutUninitializedState[componentName]) {
428
warning(
429
false,
@@ -575,7 +575,7 @@ export default function(
575
576
if (__DEV__) {
577
if (partialState === undefined) {
578
- const componentName = getComponentName(workInProgress) || 'Unknown';
578
+ const componentName = getComponentName(workInProgress) || 'Component';
579
if (!didWarnAboutUndefinedDerivedState[componentName]) {
580
warning(
581
false,