From: daiwei Date: Tue, 31 Dec 2024 08:11:41 +0000 (+0800) Subject: fix(runtime-core): prevent updating instance if it's already the current instance X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ffbe87e7a3bda9666245e7e5b1565cd35b9cc5ea;p=thirdparty%2Fvuejs%2Fcore.git fix(runtime-core): prevent updating instance if it's already the current instance --- diff --git a/packages/runtime-core/src/component.ts b/packages/runtime-core/src/component.ts index 3ed42ed0b5..cf8a17e9d2 100644 --- a/packages/runtime-core/src/component.ts +++ b/packages/runtime-core/src/component.ts @@ -760,7 +760,10 @@ if (__SSR__) { } } -export const setCurrentInstance = (instance: ComponentInternalInstance) => { +export const setCurrentInstance = ( + instance: ComponentInternalInstance, +): (() => void) => { + if (currentInstance === instance) return NOOP const prev = currentInstance internalSetCurrentInstance(instance) instance.scope.on()