A simple drag and drop library for React which uses the more stable mouseDown/mouseUp event pattern instead of the problematic HTML5 drag and drop API
Since react-dragtastic
was released it's been used in a variety of interesting ways that we never even imagined. This new release helps alleviate a performance pain point of a common scenario, rendering large numbers of draggables and droppables. Now every exported component has a new optional prop called subscribeTo
, which accepts an array of strings. If this prop is present the component's render prop function will only be called if at least one of the keys that was passed has changed.
forceUpdate
to setState
for improved render performance. (Thanks @TrySound!)DragComponent
to allow it to always render regardless of whether or not you're dragging.Highlights:
A big thanks to @TrySound for contributing massively to this release!
Added new component for providing dragState without attaching events. See README for DragState
Added additional event hooks:
Draggable
dragsDroppable
is entered.Droppable
is left.Draggables now wait for the user's pointer to travel a specified distance before activating. Defaults to 8 pixels. See Draggable
documentation for more info.
Added a new state property, isOverAccepts
. See documentation for more
Miscellaneous bug fixes.
Version 2.0 represents a total rewrite of react-dragtastic
. In this new release there are now 3 available components:
Also included in this release: