File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
packages/babel-plugin-jsx/src Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -459,7 +459,11 @@ const transformJSXElement = (
459459 t . identifier ( 'default' ) ,
460460 child ,
461461 ) ,
462- ] ) ;
462+ optimize && t . objectProperty (
463+ t . identifier ( '_' ) ,
464+ t . numericLiteral ( slotFlag ) ,
465+ ) as any ,
466+ ] . filter ( Boolean ) ) ;
463467 } else if ( t . isObjectExpression ( child ) ) {
464468 VNodeChild = t . objectExpression ( [
465469 ...child . properties ,
@@ -472,9 +476,13 @@ const transformJSXElement = (
472476 VNodeChild = isComponent ? t . objectExpression ( [
473477 t . objectProperty (
474478 t . identifier ( 'default' ) ,
475- t . arrowFunctionExpression ( [ ] , t . arrayExpression ( [ child ] ) ) ,
479+ t . arrowFunctionExpression ( [ ] , child ) ,
476480 ) ,
477- ] ) : t . arrayExpression ( [ child ] ) ;
481+ optimize && t . objectProperty (
482+ t . identifier ( '_' ) ,
483+ t . numericLiteral ( slotFlag ) ,
484+ ) as any ,
485+ ] . filter ( Boolean ) ) : t . arrayExpression ( [ child ] ) ;
478486 }
479487 }
480488
You can’t perform that action at this time.
0 commit comments