Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/shared/utils/getComponentName.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this one necessary?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops no. Send a pr?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
if (typeof instanceOrFiber.tag === 'number') {
// Fiber reconciler
Expand All @@ -32,6 +32,7 @@ function getComponentName(instanceOrFiber : ReactInstance | Fiber) : string | nu
return type.displayName || type.name || null;
}
}
return null;
}

module.exports = getComponentName;