You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a problem with the typings of that library. Doing & { value: unknown } doesn't cast that value to unknown; in general when something should be overwritten, Omit<.., 'value'> & { value: .. } should be used
Describe the bug
When passing through props from e.g.
<li>
elementhttps://github.com/sveltejs/svelte/blob/7e6acbece31fbd68e2c07e37f3c849c405eb6983/elements/index.d.ts#L796-L798
it doesn't seem to be possible to override the default typing for
value
e.g. consider this component that defaults to rendering as<li>
elementhttps://github.com/rgossiaux/svelte-headlessui/blob/master/src/lib/components/listbox/ListboxOption.svelte#L7
the value there expects
unknown
type but when you try to assign any/unknown type you get an error because index.d.ts typing takes precendence.Reproduction
The easiest way to reproduce is to use headless ui fork for Svelte: https://svelte-headlessui.goss.io/docs/listbox and copy paste the basic example.
Expected behaviour
It shouldn't give typescript error
System Info
Which package is the issue about?
None
Additional Information, eg. Screenshots
sveltejs/svelte#7649
The text was updated successfully, but these errors were encountered: