Skip to content

Commit 069eb04

Browse files
committed
tagName may not always exist
1 parent 67bf11e commit 069eb04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/pretty-format/src/plugins/DOMElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const testHasAttribute = (val: any) => {
3131
};
3232

3333
const isCustomElement = (val: any) => {
34-
const {tagName} = val;
34+
const tagName = val?.tagName;
3535
return (
3636
(typeof tagName === 'string' && tagName.includes('-')) ||
3737
testHasAttribute(val)

0 commit comments

Comments
 (0)