mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-15 17:47:49 +08:00
Add typings for onDragUpdate
While mentioned in the docs, attempting to use onDragUpdate will cause a type error. This PR introduces typings for onDragUpdate that are consistent with the docs:
`type DragUpdate = {|
...DragStart,
// may not have any destination (drag to nowhere)
destination: ?DraggableLocation,
|}`
This commit is contained in:
5
types/react-beautiful-dnd/index.d.ts
vendored
5
types/react-beautiful-dnd/index.d.ts
vendored
@@ -28,6 +28,10 @@ export interface DragStart {
|
||||
source: DraggableLocation;
|
||||
}
|
||||
|
||||
export interface DragUpdate extends DragStart {
|
||||
destination?: DraggableLocation;
|
||||
}
|
||||
|
||||
export interface DropResult {
|
||||
draggableId: DraggableId;
|
||||
type: TypeId;
|
||||
@@ -37,6 +41,7 @@ export interface DropResult {
|
||||
|
||||
export interface DragDropContextProps {
|
||||
onDragStart?(initial: DragStart): void;
|
||||
onDragUpdate?(initial: DragUpdate): void;
|
||||
onDragEnd(result: DropResult): void;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user