diff --git a/src/runtime/internal/scheduler.ts b/src/runtime/internal/scheduler.ts index 1ce255b217..96fecc1fec 100644 --- a/src/runtime/internal/scheduler.ts +++ b/src/runtime/internal/scheduler.ts @@ -37,11 +37,13 @@ export function flush() { do { // first, call beforeUpdate functions // and update components - while (dirty_components.length) { - const component = dirty_components.shift(); + for (let i = 0; i < dirty_components.length; i += 1) { + const component = dirty_components[i]; set_current_component(component); update(component.$$); } + + dirty_components.length = 0; while (binding_callbacks.length) binding_callbacks.pop()();