useDroppableCollectionState

Manages state for a droppable collection.

installyarn add react-stately
version3.21.0
usageimport {useDroppableCollectionState} from 'react-stately'

API#


useDroppableCollectionState( (props: DroppableCollectionStateOptions )): DroppableCollectionState

Interface#


Properties

NameTypeDescription
collectionCollection<Node<unknown>>A collection of items.
selectionManagerMultipleSelectionManagerAn interface for reading and updating multiple selection state.
targetDropTargetnullThe current drop target.

Methods

MethodDescription
setTarget( (target: DropTarget )): voidSets the current drop target.
isDropTarget( (target: DropTarget )): booleanReturns whether the given target is equivalent to the current drop target.
getDropOperation( (e: DropOperationEvent )): DropOperationReturns the drop operation for the given parameters.

Example#


See the docs for useDroppableCollection in react-aria for an example of useDroppableCollectionState.