fix: checkIsComponent got wrong result

This commit is contained in:
Amour1688 2020-07-12 02:04:51 +08:00
parent 17a0e56342
commit 5c59e2e27b

View File

@ -44,7 +44,7 @@ const checkIsComponent = (path: NodePath<t.JSXOpeningElement>): boolean => {
return !isFragment(namePath); // For withCtx return !isFragment(namePath); // For withCtx
} }
const tag = (namePath as NodePath<t.JSXIdentifier>).get('name'); const tag = (namePath as NodePath<t.JSXIdentifier>).node.name;
return !htmlTags.includes(tag) && !svgTags.includes(tag); return !htmlTags.includes(tag) && !svgTags.includes(tag);
}; };