Skip to content

Commit

Permalink
fix: fix htmlTags type error
Browse files Browse the repository at this point in the history
  • Loading branch information
sodatea committed Oct 14, 2022
1 parent 65cad55 commit bc9b1d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/babel-plugin-jsx/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const checkIsComponent = (path: NodePath<t.JSXOpeningElement>, state: Sta

const tag = (namePath as NodePath<t.JSXIdentifier>).node.name;

return !state.opts.isCustomElement?.(tag) && shouldTransformedToSlots(tag) && !htmlTags.includes(tag) && !svgTags.includes(tag);
return !state.opts.isCustomElement?.(tag) && shouldTransformedToSlots(tag) && !htmlTags.includes(tag as htmlTags.htmlTags) && !svgTags.includes(tag);
};

/**
Expand Down Expand Up @@ -86,7 +86,7 @@ export const getTag = (
const namePath = path.get('openingElement').get('name');
if (namePath.isJSXIdentifier()) {
const { name } = namePath.node;
if (!htmlTags.includes(name) && !svgTags.includes(name)) {
if (!htmlTags.includes(name as htmlTags.htmlTags) && !svgTags.includes(name)) {
return (name === FRAGMENT
? createIdentifier(state, FRAGMENT)
: path.scope.hasBinding(name)
Expand Down

0 comments on commit bc9b1d5

Please sign in to comment.