Skip to main content

Overview

useDragDropManager returns the DragDropManager instance that the surrounding DragDropProvider created. Use it for advanced cases that need direct access to the manager — registering custom event listeners on manager.monitor, looking up registered plugins via manager.registry, or imperatively dispatching actions. For most use cases — rendering UI based on drag state, reordering items in onDragEnd, etc. — prefer the higher-level hooks (useDragOperation, useDragDropMonitor) or the event handlers on DragDropProvider itself.
When called outside of a DragDropProvider, the hook does not return null at runtime — it returns a shared default manager instance that all provider-less hooks fall back to. The return type is still DragDropManager | null, so a null guard is needed to satisfy TypeScript.

API Reference

Output

DragDropManager | null
The DragDropManager instance from the nearest ancestor DragDropProvider, or a shared default manager instance if no provider is present.