Skip to content

Commit 36e3bb5

Browse files
Improve typings for DragOverlay.
Better describe the function form to avoid consumers seeing errors like: ` Type '(draggable: any) => Element' is not assignable to type 'FunctionElement'.ts(2322)` For #56
1 parent b5d9b4f commit 36e3bb5

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
- Don't apply redundant adjustment transformer when a drag overlay is used.
2222

23+
- Improve typings for `DragOverlay` to better describe function form.
24+
2325
## [0.7.0] - 2022-09-07
2426

2527
Refactor core to lean more into reactivity. Note there are multiple breaking

src/drag-overlay.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { Portal } from "solid-js/web";
22
import { JSX, ParentComponent, Show } from "solid-js";
33

4-
import { useDragDropContext } from "./drag-drop-context";
4+
import { Draggable, useDragDropContext } from "./drag-drop-context";
55
import { transformStyle } from "./style";
66
import { elementLayout } from "./layout";
77

88
interface DragOverlayProps {
9+
children: Element | ((activeDraggable: Draggable | null) => Element);
910
class?: string;
1011
style?: JSX.CSSProperties;
1112
}

0 commit comments

Comments
 (0)