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 @@ -512,7 +512,11 @@ const transformJSXElement = (
512
512
) {
513
513
VNodeChild = t . objectExpression ( [
514
514
t . objectProperty ( t . identifier ( 'default' ) , child ) ,
515
- ] ) ;
515
+ optimize && t . objectProperty (
516
+ t . identifier ( '_' ) ,
517
+ t . numericLiteral ( slotFlag ) ,
518
+ ) as any ,
519
+ ] . filter ( Boolean ) ) ;
516
520
} else if ( t . isObjectExpression ( child ) ) {
517
521
VNodeChild = t . objectExpression (
518
522
[
@@ -526,9 +530,13 @@ const transformJSXElement = (
526
530
? t . objectExpression ( [
527
531
t . objectProperty (
528
532
t . identifier ( 'default' ) ,
529
- t . arrowFunctionExpression ( [ ] , t . arrayExpression ( [ child ] ) )
533
+ t . arrowFunctionExpression ( [ ] , child ) ,
530
534
) ,
531
- ] )
535
+ optimize && t . objectProperty (
536
+ t . identifier ( '_' ) ,
537
+ t . numericLiteral ( slotFlag ) ,
538
+ ) as any ,
539
+ ] . filter ( Boolean ) )
532
540
: t . arrayExpression ( [ child ] ) ;
533
541
}
534
542
}
You can’t perform that action at this time.
0 commit comments