solid-dnd icon indicating copy to clipboard operation
solid-dnd copied to clipboard

TSX support for the example code

Open ken-okabe opened this issue 3 years ago • 0 comments

Thanks for the great component I've been lookin for.

Sortable list (vertical) in https://solid-dnd.com/#examples https://gist.github.com/stken2050/84de233a3f759c679dc0a6cbcfff6c50 as Sortable.jsx wokrs fine, but basically my projects are based on TS, TSX, so tried as Sortable.tsx, then unsurprisingly had errors.

image

(property) use:sortable: true
Type '{ children: any; "use:sortable": true; class: string; classList: { "opacity-25": boolean; "transition-transform": boolean; }; }' is not assignable to type 'HTMLAttributes<HTMLDivElement>'.
  Property 'use:sortable' does not exist on type 'HTMLAttributes<HTMLDivElement>'.ts(2322)

image

Type 'Element' is not assignable to type '(Element | ((activeDraggable: Draggable) => Element)) & Element'.
  Type 'number' is not assignable to type '(Element | ((activeDraggable: Draggable) => Element)) & Element'.ts(2322)
drag-overlay.d.ts(4, 5): The expected type comes from property 'children' which is declared here on type 'IntrinsicAttributes & DragOverlayProps & { children?: Element; }'

What is the proper way to avoid this error?

TSX support would be very nice. Thanks!

ken-okabe avatar Sep 22 '22 07:09 ken-okabe