Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

let:value no longer works since Svelte 4 #79

Open
schindld opened this issue Jul 21, 2023 · 1 comment
Open

let:value no longer works since Svelte 4 #79

schindld opened this issue Jul 21, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@schindld
Copy link

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).

@metonym metonym added the bug Something isn't working label Jul 21, 2023
@schindld
Copy link
Author

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants