Skip to content

Commit c73f099

Browse files
trueadmdummdidumm
andauthored
Update packages/svelte/src/internal/client/dom/legacy/lifecycle.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
1 parent fda3380 commit c73f099

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/svelte/src/internal/client/dom/legacy/lifecycle.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ export function init() {
2222
pre_effect(() => {
2323
observe_all(context);
2424
callbacks.b.forEach(run);
25+
// beforeUpdate might change state that affects rendering, ensure the render effects following from it
26+
// are batched up with the current run. Avoids for example child components rerunning when they're
27+
// now hidden because beforeUpdate did set an if block to false.
2528
flush_local_render_effects();
2629
});
2730
}

0 commit comments

Comments
 (0)