File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
packages/babel-plugin-jsx/src Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ const getJSXAttributeValue = (
46
46
47
47
const buildProps = ( path : NodePath < t . JSXElement > , state : State ) => {
48
48
const tag = getTag ( path , state ) ;
49
- const isComponent = checkIsComponent ( path . get ( 'openingElement' ) ) ;
49
+ const isComponent = checkIsComponent ( path . get ( 'openingElement' ) , state ) ;
50
50
const props = path . get ( 'openingElement' ) . get ( 'attributes' ) ;
51
51
const directives : t . ArrayExpression [ ] = [ ] ;
52
52
const dynamicPropNames = new Set < string > ( ) ;
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export const shouldTransformedToSlots = (tag: string) => !(tag.endsWith(FRAGMENT
41
41
* @param path JSXOpeningElement
42
42
* @returns boolean
43
43
*/
44
- export const checkIsComponent = ( path : NodePath < t . JSXOpeningElement > ) : boolean => {
44
+ export const checkIsComponent = ( path : NodePath < t . JSXOpeningElement > , state : State ) : boolean => {
45
45
const namePath = path . get ( 'name' ) ;
46
46
47
47
if ( namePath . isJSXMemberExpression ( ) ) {
@@ -50,6 +50,10 @@ export const checkIsComponent = (path: NodePath<t.JSXOpeningElement>): boolean =
50
50
51
51
const tag = ( namePath as NodePath < t . JSXIdentifier > ) . node . name ;
52
52
53
+ if ( state . opts . isCustomElement && state . opts . isCustomElement ( tag ) ) {
54
+ return false ;
55
+ }
56
+
53
57
return shouldTransformedToSlots ( tag ) && ! htmlTags . includes ( tag ) && ! svgTags . includes ( tag ) ;
54
58
} ;
55
59
You can’t perform that action at this time.
0 commit comments