react-draggable
A custom hook to make elements draggable.
Usage
Simplest usage:
; { const targetRef = ; return <div ref=targetRef> <h1>You can drag me :</h1> </div> );}
Usage in a class component:
;; Component { return <Draggable> <div ref=targetRef> <h1>You can drag me :</h1> <button ref=handleRef>with this handle</button> </div> ) </Draggable> ; }
Live demo
https://codesandbox.io/s/use-draggable-demo-tiu3w
Contribute
PRs are welcomed! Note - when opening a PR, make sure the last commit message abides commitizen guidelines.