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 @@ -512,7 +512,11 @@ const transformJSXElement = (
512512 ) {
513513 VNodeChild = t . objectExpression ( [
514514 t . objectProperty ( t . identifier ( 'default' ) , child ) ,
515- ] ) ;
515+ optimize && t . objectProperty (
516+ t . identifier ( '_' ) ,
517+ t . numericLiteral ( slotFlag ) ,
518+ ) as any ,
519+ ] . filter ( Boolean ) ) ;
516520 } else if ( t . isObjectExpression ( child ) ) {
517521 VNodeChild = t . objectExpression (
518522 [
@@ -526,9 +530,13 @@ const transformJSXElement = (
526530 ? t . objectExpression ( [
527531 t . objectProperty (
528532 t . identifier ( 'default' ) ,
529- t . arrowFunctionExpression ( [ ] , t . arrayExpression ( [ child ] ) )
533+ t . arrowFunctionExpression ( [ ] , child ) ,
530534 ) ,
531- ] )
535+ optimize && t . objectProperty (
536+ t . identifier ( '_' ) ,
537+ t . numericLiteral ( slotFlag ) ,
538+ ) as any ,
539+ ] . filter ( Boolean ) )
532540 : t . arrayExpression ( [ child ] ) ;
533541 }
534542 }
You can’t perform that action at this time.
0 commit comments