useDroppableCollectionState

Manages state for a droppable collection.

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

API#


useDroppableCollectionState( (props: )):

Interface#


Properties

NameTypeDescription
collection<<unknown>>A collection of items.
selectionManagerAn interface for reading and updating multiple selection state.
targetnullThe current drop target.
isDisabledbooleanWhether drop events are disabled.

Methods

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

Example#


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