File tree 1 file changed +11
-3
lines changed
packages/babel-plugin-jsx/src
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -459,7 +459,11 @@ const transformJSXElement = (
459
459
t . identifier ( 'default' ) ,
460
460
child ,
461
461
) ,
462
- ] ) ;
462
+ optimize && t . objectProperty (
463
+ t . identifier ( '_' ) ,
464
+ t . numericLiteral ( slotFlag ) ,
465
+ ) as any ,
466
+ ] . filter ( Boolean ) ) ;
463
467
} else if ( t . isObjectExpression ( child ) ) {
464
468
VNodeChild = t . objectExpression ( [
465
469
...child . properties ,
@@ -472,9 +476,13 @@ const transformJSXElement = (
472
476
VNodeChild = isComponent ? t . objectExpression ( [
473
477
t . objectProperty (
474
478
t . identifier ( 'default' ) ,
475
- t . arrowFunctionExpression ( [ ] , t . arrayExpression ( [ child ] ) ) ,
479
+ t . arrowFunctionExpression ( [ ] , child ) ,
476
480
) ,
477
- ] ) : t . arrayExpression ( [ child ] ) ;
481
+ optimize && t . objectProperty (
482
+ t . identifier ( '_' ) ,
483
+ t . numericLiteral ( slotFlag ) ,
484
+ ) as any ,
485
+ ] . filter ( Boolean ) ) : t . arrayExpression ( [ child ] ) ;
478
486
}
479
487
}
480
488
You can’t perform that action at this time.
0 commit comments