svelte-material-ui
svelte-material-ui copied to clipboard
Using data-attributes on components returns type error
Describe the bug Trying to use a data-attribute on a component using Typescript returns a type error.
To Reproduce Steps to reproduce the behavior:
- Import the Accordion component within a
<script lang="ts" />
block - Use it as so:
<Accordion data-state="123" />
- Run
svelte-check
- See error:
Object literal may only specify known properties, and '"data-state"' does not exist in type '{ getElement?: (() => HTMLDivElement) | undefined; use?: ActionArray | undefined; class?: string | undefined; multiple?: boolean | undefined; cite?: string | null | undefined; ... 319 more ...; 'sveltekit:reload'?: true | ... 1 more ... | undefined; }'. (ts)
<Accordion data-state="123" />
Expected behavior I expect to be able to use data-attributes on a Typescript environment without errors
Screenshots
Desktop (please complete the following information):
- OS: Windows 10 WSL Ubuntu
- Browser N/A
- Version N/A
Smartphone (please complete the following information): N/A
Additional context N/A
I'm also getting this error. There is probably a way to tell typescript that it does exist
I'm also getting this error. There is probably a way to tell typescript that it does exist
I think this is probably something to do with the Svelte Language Server
Anyone found a good workaround for this yet? We're trying to upgrade to latest smui and this is blocking us :/
Svelte issue: https://github.com/sveltejs/language-tools/issues/1825