
Show HN: React Dragtastic – Frustration-Free Drag and Drop for React JS - chrisjpatty
https://github.com/chrisjpatty/react-dragtastic#v2
======
yodon
How would you compare your project to Dragula’s React wrapper?

~~~
chrisjpatty
So Dragtastic came out of my own difficulty finding a React drag and drop
library that was both easy to setup and easily extensible. Dragula was one
that I looked at during that process. I only briefly looked into Dragula, so I
can't say that I have a full breadth of knowledge about the differences, but
from what I can tell the overall paradigm is somewhat different. Where some
DND libraries attempt to abstract most of the rendering away from you as the
developer, dragtastic uses the "function-as-child" rendering method to allow
the developer full control over the rendering of their components. It's
similar in a way to how Kent Dodd's Downshift library operates
[https://github.com/paypal/downshift](https://github.com/paypal/downshift).

Essentially Dragtastic manages all the events and state required for cross-
browser drag and drop interactions, but instead of rendering your components
for you, you provide a function in which Dragtastic injects all the state and
events you need to hookup your own components. Hopefully that answers your
question.

 _Edit:_ I should mention as well that Dragula and other similar more-mature
libraries have more complete APIs. I'm continually adding more features to
Dragtastic, so for developers requiring a complete API may want to look
elsewhere for now or consider contributing. ;)

~~~
yodon
Very helpful, thanks, that does sound quite different from Dragula which makes
a big point of how it automatically manages rendering of the being-dragged
components.

~~~
chrisjpatty
Which there's definitely a good use-case for. Sometimes you need something
that just works without much configuration. React-dnd comes to mind as a
package that goes the other direction and is super customizable, but not very
easy to just drop in and start using. With dragtastic I've tried to strike a
happy medium between the two. :)

