Home
Examples
Github
Search…
Overview
Introduction
Installation
Quick start
API Documentation
DndContext
Collision detection algorithms
useDndContext
useDndMonitor
Droppable
Draggable
Sensors
Modifiers
Presets
Sortable
Guides
Accessibility
Powered By
GitBook
useDndMonitor
The
useDndMonitor
hook can be used within components wrapped in a
DndContext
provider to monitor the different drag and drop events that happen for that
DndContext
.
1
import
{
DndContext
,
useDndMonitor
}
from
'@dnd-kit/core'
;
2
3
function
App
()
{
4
return
(
5
<
DndContext
>
6
<
Component
/>
7
</
DndContext
>
8
);
9
}
10
11
function
Component
()
{
12
// Monitor drag and drop events that happen on the parent `DndContext` provider
13
useDndMonitor
({
14
onDragStart
(
event
)
{},
15
onDragMove
(
event
)
{},
16
onDragOver
(
event
)
{},
17
onDragEnd
(
event
)
{},
18
onDragCancel
(
event
)
{},
19
});
20
}
Copied!
Previous
useDndContext
Next - API Documentation
Droppable
Last modified
1yr ago
Copy link
Edit on GitHub