Skip to content

chore: add dnd hooks to rac #8743

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

snowystinger
Copy link
Member

@snowystinger snowystinger commented Aug 20, 2025

Closes #8688

Not sure if there are enough uses to warrant it. I updated any places in our stories/docs, which was two places.

Edit:
Talked about with team, this moves us closer to monopackages, which is the direction we'd like to head.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@rspbot
Copy link

rspbot commented Aug 20, 2025

@rspbot
Copy link

rspbot commented Aug 20, 2025

## API Changes

react-aria-components

/react-aria-components:useDrag

+useDrag {
+  options: DragOptions
+  returnVal: undefined
+}

/react-aria-components:useDrop

+useDrop {
+  options: DropOptions
+  returnVal: undefined
+}

/react-aria-components:DragOptions

+DragOptions {
+  getAllowedDropOperations?: () => Array<DropOperation>
+  getItems: () => Array<DragItem>
+  hasDragButton?: boolean
+  isDisabled?: boolean
+  onDragEnd?: (DragEndEvent) => void
+  onDragMove?: (DragMoveEvent) => void
+  onDragStart?: (DragStartEvent) => void
+  preview?: RefObject<DragPreviewRenderer | null>
+}

/react-aria-components:DragResult

+DragResult {
+  dragButtonProps: AriaButtonProps
+  dragProps: HTMLAttributes<HTMLElement>
+  isDragging: boolean
+}

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

useDrag should be exposed in react-aria-components
3 participants