mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Fix Flow (#8857)
This commit is contained in:
1 parent
2be0583ed3
commit
7683211efd
1 file changed
+2
-1
@@ -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;
|
||||
Reference in new issue
Block a user