Update dependencies
Update your After updating your package.json, install the new dependencies with your package manager of choice.
package.json and install the new packages:Migrate context provider
Update your context provider. The new DragDropProvider replaces the legacy
DndContext:The new provider gives you access to the
manager instance in event handlers, enabling more advanced control over the drag and drop system.Update draggable components
Update your draggable components using the new useDraggable hook:
Update droppable components
Update your droppable components using the new useDroppable hook:
Update drag overlay
The DragOverlay component has been simplified:
Migrate sortable components
Update your sortable components using the new useSortable hook:Use the array manipulation helpers from
@dnd-kit/helpers to handle reordering.API reference
A quick lookup for common legacy APIs and their new equivalents, organized by category.Context & Provider
Legacy (@dnd-kit/core) | New (@dnd-kit/react) |
|---|---|
DndContext | DragDropProvider |
Events
| Legacy | New |
|---|---|
active | event.operation.source |
over | event.operation.target |
active.id | event.operation.source.id |
onDragCancel | Check event.canceled inside onDragEnd |
Sensors
The legacy If you don’t configure it, the default already differentiates pointer types — see the PointerSensor docs for the full default behavior.
MouseSensor and TouchSensor have been merged into a single PointerSensor that handles mouse, touch, and pen input via the native Pointer Events API. You can still apply different behavior per input type by passing a function to activationConstraints and branching on event.pointerType ('mouse', 'touch', or 'pen'):Legacy (@dnd-kit/core) | New (@dnd-kit/dom) |
|---|---|
useSensor / useSensors | Built-in by default. Customize via the sensors prop on DragDropProvider |
MouseSensor | PointerSensor from @dnd-kit/dom |
TouchSensor | PointerSensor from @dnd-kit/dom |
PointerSensor | PointerSensor from @dnd-kit/dom |
KeyboardSensor | KeyboardSensor from @dnd-kit/dom |
Collision detection
| Legacy | New |
|---|---|
collisionDetection prop on DndContext | collisionDetector option on useDroppable / useSortable |
pointerWithin | pointerIntersection from @dnd-kit/collision |
closestCenter | closestCenter from @dnd-kit/collision |
closestCorners | closestCorners from @dnd-kit/collision |
Modifiers
See the React modifiers guide for usage examples.| Legacy | New |
|---|---|
restrictToParentElement | RestrictToElement from @dnd-kit/dom/modifiers |
restrictToWindowEdges | RestrictToWindow from @dnd-kit/dom/modifiers |
restrictToVerticalAxis | RestrictToVerticalAxis from @dnd-kit/abstract/modifiers |
restrictToHorizontalAxis | RestrictToHorizontalAxis from @dnd-kit/abstract/modifiers |
createSnapModifier | SnapModifier from @dnd-kit/abstract/modifiers |
Sortable
SortableContext is no longer needed. Sortable items register and coordinate with the DragDropProvider automatically when you use useSortable — there’s no wrapping context to configure. Use the type and accept options on useSortable to control which items can be sorted together.| Legacy | New |
|---|---|
SortableContext | No longer needed — see note above |
arrayMove | move from @dnd-kit/helpers |
verticalListSortingStrategy | Not needed — handled automatically |
horizontalListSortingStrategy | Not needed — handled automatically |
rectSortingStrategy | Not needed — handled automatically |
Next steps
Quickstart guide
Build beautiful drag and drop interfaces in minutes with the new dnd kit
Managing sortable state
Use the
move helper from @dnd-kit/helpers or manage state manuallyModifiers
Restrict movement to an element, axis, or snap to a grid in React
Feedback
Configure drag feedback, clone overlays, and drop animations in React