Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Why is this object not updating?

$
0
0

Reproduction: https://svelte.dev/playground/4424d522f50847f0b872a094b7b2198b?version=5.18.0

I cannot understand why this error:

[svelte] binding_property_non_reactive`bind:value={content.one}` (Form.svelte:5:19) is binding to a non-reactive propertyhttps://svelte.dev/e/binding_property_non_reactive

Code:

App.svelte:

<script>    import Form from "./Form.svelte";    let changed = $state(false);    let content = $derived({one: `hello ${changed}`, two: changed });</script><Form bind:content={() => content, (v) => content = v} />

Form.svelte:

<script>    let { content = $bindable() } = $props();</script><input type="text" bind:value={content.one} />

Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>