thisbeyond / solid-dnd

A lightweight, performant, extensible drag and drop toolkit for Solid JS.
https://solid-dnd.com
MIT License
510 stars 35 forks source link

Update component type definitions to add children prop #42

Closed hnagrath09 closed 2 years ago

hnagrath09 commented 2 years ago

Getting the following TS error for all the solid-dnd components.

Type '{ children: Element[]; onDragEnd: ({ draggable, droppable, }: { draggable: Draggable; droppable: Droppable; }) => void; onDragStart: ({ draggable }: { draggable: Draggable; }) => void; collisionDetector: CollisionDetector; }' is not assignable to type 'IntrinsicAttributes & DragDropContextProps'.
  Property 'children' does not exist on type 'IntrinsicAttributes & DragDropContextProps'.

solidjs updated their type definition of Component in v1.4.0. A copy from their release notes: https://github.com/solidjs/solid/releases/tag/v1.4.0

Better Types around Components This one took the effort of many resident TypeScript experts, but we've now landed on some better types for components. The biggest change is Component no longer has an opinion on whether it should have children or not. We've added supplementary types ParentComponent and FlowComponent to denote Components that may have children or always have children. And we've added VoidComponent for those which may never have children.

martinpengellyphillips commented 2 years ago

Yep - see #39