svelte
svelte copied to clipboard
Svelte 5 migration: erroneous `$state` declaration when `each` block present
Describe the bug
This...
<script>
const { foo } = x();
</script>
{#each foo as f}{/each}
...gets turned into this by the migrator:
<script lang="ts">
const { foo } = $state(x());
</script>
{#each foo as f}{/each}
There's no reason for this to be state.