You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a Writable is passed to a component as prop and then the prop is accessed by "$" sign then this error occurs: "Can only bind to state or props". It works with non-rune props declaration.
$state is a rune, you cannot have a store with the same name and expect that to work in runes mode.
Apparently that should be possible, the following would be a workaround:
Rename it to anything that does not conflict.
<script>
let { state: store } =$props();
</script>
<inputtype="text"bind:value={$store} />
I think there is a slight bug here. Having a state variable in the component's scope is supposed to disable the $state rune (in that it becomes an autosubscription to the state store) - and the same thing with the other runes - but apparently that's not happening for component scope that's coming from props.
Describe the bug
When a Writable is passed to a component as prop and then the prop is accessed by "$" sign then this error occurs: "Can only bind to state or props". It works with non-rune props declaration.
Reproduction
REPL: https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACj2OwWrDMBBEf2VYAm3B4LtiG_oVPUQ92NamXqpIQlrHCcb_HpxAjjPMPN5KZ_FcyJxWCv2FydB3SlSR3tMeypW9MlVU4pzHvWnKmCVpZwMA1DX4lmJWeFYU7ZUNfrJoP3huimYJf90ROknBEvN_seF9XEQn6MQYo2MM7H1cIAoXuYQPfe5f4529vujY0OKQckzl8-toQ1O_fWxoJKRZsbu3lpRvagmDBGeuvZ-5XQ9Pxoa6o4ou0clZ2JHRPPP2uz0AAC8RWA0BAAA=
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: