Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
brunnerh opened this issue Feb 17, 2025 · 0 comments · Fixed by #15318
Closed

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

brunnerh opened this issue Feb 17, 2025 · 0 comments · Fixed by #15318

Comments

@brunnerh
Copy link
Member

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

@brunnerh brunnerh changed the title binding_property_non_reactive false positive binding to store in #each binding_property_non_reactive false positive when binding to store in #each Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant