@@ -121,7 +121,13 @@ export const transformElement: NodeTransform = (node, context) => {
121
121
122
122
// props
123
123
if ( props . length > 0 ) {
124
- const propsBuildResult = buildProps ( node , context )
124
+ const propsBuildResult = buildProps (
125
+ node ,
126
+ context ,
127
+ undefined ,
128
+ isComponent ,
129
+ isDynamicComponent
130
+ )
125
131
vnodeProps = propsBuildResult . props
126
132
patchFlag = propsBuildResult . patchFlag
127
133
dynamicPropNames = propsBuildResult . dynamicPropNames
@@ -380,6 +386,8 @@ export function buildProps(
380
386
node : ElementNode ,
381
387
context : TransformContext ,
382
388
props : ElementNode [ 'props' ] = node . props ,
389
+ isComponent : boolean ,
390
+ isDynamicComponent : boolean ,
383
391
ssr = false
384
392
) : {
385
393
props : PropsExpression | undefined
@@ -389,7 +397,6 @@ export function buildProps(
389
397
shouldUseBlock : boolean
390
398
} {
391
399
const { tag, loc : elementLoc , children } = node
392
- const isComponent = node . tagType === ElementTypes . COMPONENT
393
400
let properties : ObjectExpression [ 'properties' ] = [ ]
394
401
const mergeArgs : PropsExpression [ ] = [ ]
395
402
const runtimeDirectives : DirectiveNode [ ] = [ ]
@@ -411,8 +418,8 @@ export function buildProps(
411
418
const name = key . content
412
419
const isEventHandler = isOn ( name )
413
420
if (
414
- ! isComponent &&
415
421
isEventHandler &&
422
+ ( ! isComponent || isDynamicComponent ) &&
416
423
// omit the flag for click handlers because hydration gives click
417
424
// dedicated fast path.
418
425
name . toLowerCase ( ) !== 'onclick' &&
0 commit comments