14.0.0
This release addresses a handful of nagging liveness and ergonomic issues with the hooks API.
The liveness issues affect all hooks, and were discovered on deeper inspection of certain stress tests in the documentation. The internal useCollector() hook is used to collect props from the DnD system when things change. Prior to this update, we subscribed to updates from the DnD monitor to trigger prop collection. However, state on the react side was only accounted for on the first render. This release improves that liveness by collecting props whenever react state changes.
The ergonomics of the useDrag have been refactored. In short:
spec.typeis requiredspec.itemcan be a function or static object.- The function version of
spec.itemreplacesspec.begin
Since the release of the hooks API, we packed type under spec.item. However, this led to nonintuitive situations where an item field was required to be specified even though items are created in the begin method.
Additionally, in the original React-DnD design, was optional and the of the draggables had to be defined. If no explicit DragObject was created, an implicit object was created by the system..