New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hooks API Updates #1255
Merged
Merged
Hooks API Updates #1255
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
darthtrevino
changed the title
Improvements on Hooks API
Improvements on Hooks API (WIP)
Mar 8, 2019
The hook-based examples will be in another package for now
Great to see support for hooks! Do you have an idea of how long till it's production ready? |
Thanks! I don't have a fixed time-range for when the hooks-based API will be ready, but the main things I'd like to see are:
|
darthtrevino
added a commit
that referenced
this pull request
Feb 3, 2022
* docs: move the simple sortable example to hooks * refactor: rename useDragSource to useDrag, useDropTarget to useDrop * refactor: update dragSource/dropTarget specs to include ref and type * refactor: cleanup in useDrag, useDrop * docs: spelling correction * refactor: move internal hooks to an internal folder * refactor: break up the interfaces a bit * refactor: rename beginDrag => begin, endDrag => end * refactor: put the hooks feature behind an annoying name * refactor: revert the canonical examples to using the class-based api The hook-based examples will be in another package for now * fix: ts issues
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Naming
useDragSource
=>useDrag
useDropTarget
=>useDrop
Specifications
useDrag({ref, type, ...})
useDrop({ref, type, ...})
Moving some examples over to hooks as a test-bed. Currently the simple-sortable example can get out of sync with the dragdrop state
Reverting the documentation to using the class-based API so that newcomers do not think the hooks API is idiomatic at this point.
NOTE:
The hooks API will be placed inside of a super annoying namespace in react-dnd until it's ready for production: