react-use-pointer-drag
v0.1.2
Published
<h1 align="center"> react-use-pointer-drag </h1>
Downloads
474
Maintainers
Readme
Example usage
Simple:
// In component:
const { dragProps } = usePointerDrag({
onMove: ({ x, y }) => {
// Do something.
},
});
return <div {...dragProps()} />;
With state:
// In component:
const { dragProps } = usePointerDrag<{ clip: Clip }>({
onMove: ({ x, y, state: { clip } }) => {
// Do something.
},
});
return <div {...dragProps({ clip })} />;