-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
Slot prop types from generic components not propagating upwards #1617
Comments
A workaround I have discovered is to force Svelte to adopt a better interface for type T = $$Generic
interface $$Slots {
default: { abc: T }
} I still feel as if this should be automatic though |
Probably duplicate of #1344 |
In our case using the svelte-checker with '--use-new-transformation' has fixed the problem. No problems with VSCode. The issue only occurred in some situations (some components worked, others didn't). |
How does one apply this change? |
Describe the bug
When using experimental generics, there is a bug happening where the
let:prop
type is not being passed up to the parent component, causing type issues within typescript only (the code works).Reproduction
Main.svelte
The type of abc here is
unknown
when it should bestring
. This will appear as an error in VSCodeFoo.svelte
Bar.svelte
Additionally, when you remove the
name="option"
and use the default to target the default slots the type becomesany
instead ofunknown
. This does not appear as an error in VSCode, since it isany
however all the type information is goneExample using default slot:
Main.svelte
Foo.svelte
Bar.svelte
Logs
No response
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: