don't schedule effects in the next batch — the effect will be recreated if necessary

teemingc-hydration-regression-test
Rich Harris 1 day ago
parent 78a1ba262e
commit 2912e4c490
No known key found for this signature in database

@ -684,16 +684,12 @@ export class Batch {
collected_effects = null;
// if render effects wrote to state, they may have invalidated themselves (or
// an ancestor), in which case newly collected effects will be destroyed
// and recreated — hand them over to the next batch instead of running them now
var next = /** @type {Batch | null} */ (/** @type {unknown} */ (current_batch));
if (next !== null && effects.length > length) {
// an ancestor), in which case newly collected effects should not run
if (effects.length > length) {
for (var i = length; i < effects.length; i += 1) {
var e = effects[i];
if (has_dirty_ancestor(e)) {
next.schedule(e);
e.f |= DESTROYED; // prevent it from running in `flush_queued_effects`
}
}

Loading…
Cancel
Save