svelte-typeahead
svelte-typeahead copied to clipboard
let:value no longer works since Svelte 4
Svelte 4 got rid of named slot bindings: https://svelte.dev/docs/v4-migration-guide#default-slot-bindings
So, the "no-results" fragment in the readme throws an error (ReferenceError: value is not defined).
Looks like moving the variable to the "no-results" slot fixes it. So, change
<Typeahead value="abcd" {data} {extract} let:value>
<svelte:fragment slot="no-results">
No results found for "{value}"
</svelte:fragment>
</Typeahead>
to
<Typeahead value="abcd" {data} {extract}>
<svelte:fragment slot="no-results" let:value>
No results found for "{value}"
</svelte:fragment>
</Typeahead>