Open AlbertMarashi opened 2 years ago
A workaround I have discovered is to force Svelte to adopt a better interface for $$Slots
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).
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