Use the useDroppable
hook to create droppable targets for draggable elements.
useDroppable
hook requires an id
and accepts all the same options as the Droppable
class. Refer to the Input section below for more information.
useDroppable
hook is a thin wrapper around the Droppable class that makes it easier to create droppable targets in React. It therefore accepts all of the same input arguments.useDroppable
hook accepts the following arguments:
element
option instead of using the ref
that is returned by the useDraggable
hook to connect the draggable source element.type
.true
to prevent the droppable element from being a drop target.useDraggable
hook element is unmounted.useDroppable
hook returns an object containing the following properties: