Skip to content

Commit 3ee7b4c

Browse files
committed
fix(runtime-core): avoid recursive warning
close #8074
1 parent 8655ced commit 3ee7b4c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/runtime-core/src/warning.ts

+6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ export function popWarningContext() {
3030
stack.pop()
3131
}
3232

33+
let isWarning = false
34+
3335
export function warn(msg: string, ...args: any[]) {
36+
if (isWarning) return
37+
isWarning = true
38+
3439
// avoid props formatting or warn handler tracking deps that might be mutated
3540
// during patch, leading to infinite recursion.
3641
pauseTracking()
@@ -70,6 +75,7 @@ export function warn(msg: string, ...args: any[]) {
7075
}
7176

7277
resetTracking()
78+
isWarning = false
7379
}
7480

7581
export function getComponentTrace(): ComponentTraceStack {

0 commit comments

Comments
 (0)