yarn react-dnd 7.3.1
Hooks API Update

latest releases: 16.0.1, 16.0.0, 15.1.2...
5 years ago

Updates to the non-stable, hooks-based API.

  • Add useDragPreview hook.

    • accepts a refForwarding component and returns an array with a component in slot zero that renders the component into a detached portal, and a ref in slot 1 that may be used in the dragSpec.
  • useDrag

    • the begin() function is now optional, and returns void.
    • the first argument of end() is the DragResult
    • the type property has been removed
    • add a required item property, which must contain a type field
    • make the ref field optional, if this is not set, then one will be created.
    • returns an array: collected props in slot zero and the ref being used in slot 1
  • useDrop

    • the type property has been renamed accept
    • the drop, hover and canDrop functions now take the DragItem as the first argument.
    • make the ref field optional, if this is not set, then one will be created.
    • returns an array: collected props in slot zero and the ref being used in slot 1

Don't miss a new react-dnd release

NewReleases is sending notifications on new releases.