I am trying to bind a variable from my store to a component, but get the error:
[!] (plugin svelte) ValidationError: Cannot bind to a variable which is not writable
Here is my sample code:
<Textfield bind:value={startDate} label="Start Date" type="datetime-local" />
To use a store variable, one can rely on the "update" callback, or use the specific syntax
<Textfield bind:value={$startDate} label="Start Date" type="datetime-local" />
More information on the Svelte tutorial: https://svelte.dev/tutorial/store-bindings
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With