File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
compiler-core/src/transforms Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ export const transformFor = createStructuralDirectiveTransform(
7979
8080 const isStableFragment =
8181 forNode . source . type === NodeTypes . SIMPLE_EXPRESSION &&
82- forNode . source . constType > ConstantTypes . CAN_SKIP_PATCH
82+ forNode . source . constType > ConstantTypes . NOT_CONSTANT
8383 const fragmentFlag = isStableFragment
8484 ? PatchFlags . STABLE_FRAGMENT
8585 : keyProp
Original file line number Diff line number Diff line change @@ -1036,12 +1036,15 @@ function walkDeclaration(
10361036 )
10371037 if ( id . type === 'Identifier' ) {
10381038 let bindingType
1039- if (
1039+ const userReactiveBinding = userImportAlias [ 'reactive' ] || 'reactive'
1040+ if ( isCallOf ( init , userReactiveBinding ) ) {
1041+ // treat reactive() calls as let since it's meant to be mutable
1042+ bindingType = BindingTypes . SETUP_LET
1043+ } else if (
10401044 // if a declaration is a const literal, we can mark it so that
10411045 // the generated render fn code doesn't need to unref() it
10421046 isDefineCall ||
1043- ( isConst &&
1044- canNeverBeRef ( init ! , userImportAlias [ 'reactive' ] || 'reactive' ) )
1047+ ( isConst && canNeverBeRef ( init ! , userReactiveBinding ) )
10451048 ) {
10461049 bindingType = BindingTypes . SETUP_CONST
10471050 } else if ( isConst ) {
You can’t perform that action at this time.
0 commit comments