[](https://www.npmjs.com/package/use-draggable?activeTab=versions) [](https://www.npmjs.com/package/use-draggable) [


A custom hook to make elements draggable.
``jsx
import { useDraggable } from 'use-draggable';
function MyComponent(props) {
const { targetRef } = useDraggable({ controlStyle: true });
return (
$3
`jsx
import React from 'react';
import { Draggable } from 'use-draggable';class MyComponent extends React.Component {
render() {
return (
{({ targetRef, handleRef }) => (
You can drag me :)
)}
);
}
}
``PRs are welcomed!
Note - when opening a PR, make sure the last commit message abides commitizen guidelines.