From 7683211efd1ed77636af181af05d4b5cd8edafed Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 24 Jan 2017 13:45:49 +0000 Subject: [PATCH] Fix Flow (#8857) --- src/shared/utils/getComponentName.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/utils/getComponentName.js b/src/shared/utils/getComponentName.js index a0c4609823..b6ee95b703 100644 --- a/src/shared/utils/getComponentName.js +++ b/src/shared/utils/getComponentName.js @@ -19,7 +19,7 @@ function getComponentName(instanceOrFiber : ReactInstance | Fiber) : string | nu if (typeof instanceOrFiber.getName === 'function') { // Stack reconciler const instance = ((instanceOrFiber : any) : ReactInstance); - return instance.getName() || 'Component'; + return instance.getName() || 'Component' || null; } if (typeof instanceOrFiber.tag === 'number') { // Fiber reconciler @@ -32,6 +32,7 @@ function getComponentName(instanceOrFiber : ReactInstance | Fiber) : string | nu return type.displayName || type.name || null; } } + return null; } module.exports = getComponentName;