svelte-material-ui
svelte-material-ui copied to clipboard
Textfield type error in v8-alpha
Describe the bug
Binding value of Textfield on v8 alpha with svelte 5 makes Typescript complain:
Type 'string | number | null' is not assignable to type 'string'.
To Reproduce
<script lang="ts">
import Textfield from '@smui/textfield';
let value = $state("");
</script>
<Textfield type="text" bind:value />
The only way for the error to go away is to define value
as string | number | null
which is undesirable.
Defining value
as just string
works just fine on v7 with svelte 4.