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:
Phil Nova
2018-03-19 18:37:54 -07:00
committed by GitHub
parent 9f4c751261
commit c5dddbcb97

View File

@@ -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;
}