Skip to content
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

drop, endDrag #14

Open
jamesdbrock opened this issue Oct 22, 2020 · 2 comments
Open

drop, endDrag #14

jamesdbrock opened this issue Oct 22, 2020 · 2 comments

Comments

@jamesdbrock
Copy link
Member

Thanks for upgrading this library to Hooks.

I notice you implemented drop but not end (which is confusingly also called endDrag in the React docs, if I'm reading them right?).

May I ask why? Do you think end isn't necessary, or did you just not get around to it yet? In my experience drop and endDrag behave differently. #10 Do you think purescript-react-dnd-basic should implement endDrag, and if so, do you have any advice about how to approach it?

@jamesdbrock
Copy link
Member Author

Maybe a useEffect hook would work for firing side-effects after the render from the drop event of a useDrop hook, as if the side-effects had been fired from endDrag.

@megamaddu
Copy link
Member

I just didn't get around to it. It isn't necessary for the simpler use cases, but if you're tying more of your UI to drag states and need to control other side effects it might be easier to do that from these "drag lifecycle" handlers. Your useEffect suggestion will probably work as well.

I'm not opposed to adding more of the react-dnd api, but I don't have the bandwidth to do it myself anytime soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants