@@ -398,15 +398,15 @@ const transformJSXElement = (
398
398
. map ( ( n ) => PatchFlagNames [ n ] )
399
399
. join ( ', ' ) ;
400
400
401
- const { compatibleProps } = state . opts ;
401
+ const { compatibleProps = false , usePatchFlag = true } = state . opts ;
402
402
if ( compatibleProps && ! state . get ( 'compatibleProps' ) ) {
403
403
state . set ( 'compatibleProps' , addDefault (
404
404
path , '@ant-design-vue/babel-helper-vue-compatible-props' , { nameHint : '_compatibleProps' } ,
405
405
) ) ;
406
406
}
407
407
408
408
// @ts -ignore
409
- const createVNode = t . callExpression ( createIdentifier ( state , 'createVNode' ) , [
409
+ const createVNode = t . callExpression ( createIdentifier ( state , usePatchFlag ? 'createVNode' : 'h ') , [
410
410
tag ,
411
411
// @ts -ignore
412
412
compatibleProps ? t . callExpression ( state . get ( 'compatibleProps' ) , [ props ] ) : props ,
@@ -425,12 +425,12 @@ const transformJSXElement = (
425
425
] . filter ( Boolean as any as ExcludesBoolean ) )
426
426
: t . arrayExpression ( children )
427
427
) : t . nullLiteral ( ) ,
428
- ! ! patchFlag && (
428
+ ! ! patchFlag && usePatchFlag && (
429
429
useOptimate
430
430
? t . addComment ( t . numericLiteral ( patchFlag ) , 'trailing' , ` ${ flagNames } ` , false )
431
431
: t . numericLiteral ( PatchFlags . BAIL )
432
432
) ,
433
- ! ! dynamicPropNames . size
433
+ ! ! dynamicPropNames . size && usePatchFlag
434
434
&& t . arrayExpression ( [ ...dynamicPropNames . keys ( ) ] . map ( ( name ) => t . stringLiteral ( name as string ) ) ) ,
435
435
] . filter ( Boolean as any as ExcludesBoolean ) ) ;
436
436
0 commit comments