// states.svelte.jsexport let name = $state("John"); // a state to be shared by multiple components
<!-- Component.svelte --><script> import { name } from "./states.svelte.js";</script><p>Hello, my name is <input type="text" bind:value={name} /></p>
When migrating to svelte5, I try to replace a writable store with a $state, but get error Cannot bind to import (https://svelte.dev/e/constant_binding)
.
What's the correct way to do it?