@@ -1207,7 +1207,8 @@ export function compileScript(
1207
1207
// props aliases
1208
1208
if ( propsDestructureDecl ) {
1209
1209
if ( propsDestructureRestId ) {
1210
- bindingMetadata [ propsDestructureRestId ] = BindingTypes . SETUP_CONST
1210
+ bindingMetadata [ propsDestructureRestId ] =
1211
+ BindingTypes . SETUP_REACTIVE_CONST
1211
1212
}
1212
1213
for ( const key in propsDestructuredBindings ) {
1213
1214
const { local } = propsDestructuredBindings [ key ]
@@ -1525,14 +1526,18 @@ function walkDeclaration(
1525
1526
const userReactiveBinding = userImportAlias [ 'reactive' ] || 'reactive'
1526
1527
if ( isCallOf ( init , userReactiveBinding ) ) {
1527
1528
// treat reactive() calls as let since it's meant to be mutable
1528
- bindingType = BindingTypes . SETUP_LET
1529
+ bindingType = isConst
1530
+ ? BindingTypes . SETUP_REACTIVE_CONST
1531
+ : BindingTypes . SETUP_LET
1529
1532
} else if (
1530
1533
// if a declaration is a const literal, we can mark it so that
1531
1534
// the generated render fn code doesn't need to unref() it
1532
1535
isDefineCall ||
1533
1536
( isConst && canNeverBeRef ( init ! , userReactiveBinding ) )
1534
1537
) {
1535
- bindingType = BindingTypes . SETUP_CONST
1538
+ bindingType = isCallOf ( init , DEFINE_PROPS )
1539
+ ? BindingTypes . SETUP_REACTIVE_CONST
1540
+ : BindingTypes . SETUP_CONST
1536
1541
} else if ( isConst ) {
1537
1542
if ( isCallOf ( init , userImportAlias [ 'ref' ] || 'ref' ) ) {
1538
1543
bindingType = BindingTypes . SETUP_REF
0 commit comments