From 25bc6549eb7eb487ddb761c228a27e1046c627fc Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 21 Jan 2022 09:41:54 +0800 Subject: [PATCH] perf(reactivity): optimize effect run condition --- packages/reactivity/src/effect.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/reactivity/src/effect.ts b/packages/reactivity/src/effect.ts index 351fc0c2..bb4ed09f 100644 --- a/packages/reactivity/src/effect.ts +++ b/packages/reactivity/src/effect.ts @@ -75,7 +75,7 @@ export class ReactiveEffect { if (!this.active) { return this.fn() } - if (!effectStack.includes(this)) { + if (!effectStack.length || !effectStack.includes(this)) { try { effectStack.push((activeEffect = this)) enableTracking()