Skip to content

binding_property_non_reactive false positive when binding to store in #each #15315

@brunnerh

Description

@brunnerh

Describe the bug

The warning is triggered, but the reactivity is preserved because the store is invalidated.

Reproduction

<svelte:options runes />
<script>
	import { writable } from 'svelte/store';

	const array = writable([{ name: 'tama' }]);
</script>

<button onclick={() => {
	$array.push({ name: 'new name' });
	$array = $array;
}}>add</button> <br/>

{#each $array as item}
	<div><input bind:value={item.name} /></div>
{/each}
{#each $array as item}
	<p>{item.name}</p>
{/each}

Playground

Editing the inputs updates the paragraphs below.

Logs

System Info

REPL

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions