Drag and drop sans the GUI.
Work in progress.
This is a clean re-implementation of drag and drop primitives and will eventually become core of React DnD.
To give you a better idea:
- There is no DOM here
- We let you define drop target and drag source logic
- We let you supply custom underlying implementations (console, DOM via jQuery, React, React Native, whatever)
- We manage drag source and drop target interaction
This was written to support some rather complicated scenarios that were too hard to implement in React DnD due to its current architecture:
- Mocking drag and drop interaction in tests
- Full support for arbitrary nesting and handling drag sources and drop targets
- Dragging multiple items at once
- Even when source is removed, letting another drag source “represent it” (e.g. card disappeared from one Kanban list, reappeared in another one)
All of this should be easy to implement in React DnD (and any other library using dnd-core) once dnd-core matures.
Tests should give you some idea. You register drag sources and drop targets, hook up a backend (you can use barebone TestBackend
or implement a fancy real one yourself), and your drag sources and drop targets magically begin to interact.