perf(reactivity): optimize effect run condition

This commit is contained in:
Evan You 2022-01-21 09:41:54 +08:00
parent 4768f26f59
commit 25bc6549eb

View File

@ -75,7 +75,7 @@ export class ReactiveEffect<T = any> {
if (!this.active) {
return this.fn()
}
if (!effectStack.includes(this)) {
if (!effectStack.length || !effectStack.includes(this)) {
try {
effectStack.push((activeEffect = this))
enableTracking()