Skip to content

Plan for new dnd interfaces

Stephen Mckellar edited this page Dec 5, 2017 · 2 revisions

DragContext()

  • creates store

DragSource() => { } makes it draggable

  • is type
  • this.onDragStart() // return props
  • updates context
  • cb this.onDrop();

DropTarget() => { responds to events, makes it droppable

  • accepts type
  • cb this.onDrop();

DragSourceMonitor() => { isDragging() getItemType() getItem() }

DropTargetMonitor() => { } isOver() isCompatableTarget()

DragLayerMonitor() => { isDragging() getItemType() getItem() }

accepts: [ItemTypes.GLASS]

context = { active: sourceId, sources: [{isDragging}], targets: [{isOver}] };

Clone this wiki locally