Skip to content

Commit 734c65b

Browse files
committed
fix(compiler-core): do not mark v-for as stable on const bindings
since the source value may be a reactive array fix vitejs/vite#1956
1 parent ec8fd10 commit 734c65b

File tree

1 file changed

+3
-2
lines changed
  • packages/compiler-core/src/transforms

1 file changed

+3
-2
lines changed

packages/compiler-core/src/transforms/vFor.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ import {
2323
VNodeCall,
2424
ForRenderListExpression,
2525
BlockCodegenNode,
26-
ForIteratorExpression
26+
ForIteratorExpression,
27+
ConstantTypes
2728
} from '../ast'
2829
import { createCompilerError, ErrorCodes } from '../errors'
2930
import {
@@ -78,7 +79,7 @@ export const transformFor = createStructuralDirectiveTransform(
7879

7980
const isStableFragment =
8081
forNode.source.type === NodeTypes.SIMPLE_EXPRESSION &&
81-
forNode.source.constType > 0
82+
forNode.source.constType > ConstantTypes.CAN_SKIP_PATCH
8283
const fragmentFlag = isStableFragment
8384
? PatchFlags.STABLE_FRAGMENT
8485
: keyProp

0 commit comments

Comments
 (0)