Skip to content

Commit c449039

Browse files
committed
fix: scope. on should be run before the constructor of ReactiveEffect is run to avoid effct being collected in the wrong scope
1 parent db140a1 commit c449039

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/runtime-vapor/src/renderEffect.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ export function renderEffect(cb: () => void) {
4343
effect.run()
4444
}
4545
}
46-
46+
const reset = instance && setCurrentInstance(instance)
4747
effect = new ReactiveEffect(() => {
48-
const reset = instance && setCurrentInstance(instance)
4948
callWithAsyncErrorHandling(cb, instance, VaporErrorCodes.RENDER_FUNCTION)
5049
reset?.()
5150
})

0 commit comments

Comments
 (0)