3 ms·
How would you compare your project to Dragula’s React wrapper?
by yodon 9y ago
How would you compare your project to Dragula’s React wrapper?
- chrisjpatty 9y agoSo 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 9y agoVery 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 9y agoWhich 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. :)