You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found an infinite loop that happens when using an each loop in combination with bind:this inside the loop. This bug happens when adding a key to the loop which results in the reactive statement (here $: list) getting reevaluated.
Here is a simple example:
<!-- List.svelte -->
<script>
exportlet data;let refs = []; $: list =data.reverse()
</script>
{#eachlistas { id }, index (id)} <!-- LOOP HERE because of (id) key -->
<divbind:this={refs[index]}>
content
</div>
{/each}
Describe the bug
I found an infinite loop that happens when using an
each
loop in combination withbind:this
inside the loop. This bug happens when adding a key to the loop which results in the reactive statement (here$: list
) getting reevaluated.Here is a simple example:
Reproduction
https://svelte.dev/repl/d375d7fb7a5c4df7b21f9fa60284dbad?version=3.44.1
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: