Skip to main content

Function: useDropZone()

function useDropZone<T>(__namedParameters?): object;

Defined in: react/src/hooks/useDropZone.ts:26

Take files dropped onto an element.

Any element can become a drop target this way — a waveform display, a track lane, a canvas — without wrapping it in anything.

Type Parameters​

Type Parameter
T extends Element

Parameters​

ParameterType
__namedParametersUseDropZoneOptions

Returns​

object

a ref callback for the element, and whether a drag is over it

invalid​

invalid: boolean;

over​

over: boolean;

refCallback​

refCallback: (node) => void;

Parameters​

ParameterType
nodeT | null

Returns​

void