Skip to content
filedom
Esc
↑↓navigate↵open⌘Jpreview
On this page

useDesktopDrag

Reports a file position after dragging.

import { useDesktopDrag } from 'filedom';

useDesktopDrag(path, (position) => handleDrop(position));

For a sprite, use its onDragged prop instead.

Parameters

useDesktopDrag(
  path: string | undefined,
  onDragged?: ((position: IconPosition) => void)
)

path: filesystem path to watch. Undefined disables the subscription.

onDragged: optional handler that receives the file’s new { x, y } position. Omit it to disable the subscription.

Returns

Nothing (void).

Was this page helpful?