SolidJSS
SolidJS15mo ago
57 replies
Wes

All of a sudden `classList` is typed as string | undefined

I am using SolidJS with Astro and at one point I duplicated a component file to extract logic into it and now class and classList have unexpected types:

src/Wes95/components/Window.tsx:159:14 - error ts(2322): Type '{ children: Element[]; class: string; }' is not assignable to type 'HTMLAttributes<HTMLDivElement>'.
  Property 'class' does not exist on type 'HTMLAttributes<HTMLDivElement>'.

159         <div class="WindowTitleButtons">


src/Wes95/components/Window.tsx:128:7 - error ts(2322): Type '{ Window: true; '-active': boolean; '-maximized': boolean | undefined; '-minimized': boolean | undefined; }' is not assignable to type 'string'.

128       classList={{
          ~~~~~~~~~


The reference is node_modules/.pnpm/solid-js@1.9.3/node_modules/solid-js/types/jsx.d.ts and it does only contain:
  interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
    // ...
    classList?: string | undefined;


What's going on?!
Was this page helpful?