rc-dnd-preview-image
v1.0.1
Published
enhance react-dnd DragPreviewImage
Downloads
4
Readme
rc-dnd-preview-img
enhance react-dnd DragPreviewImage
Support custom width and height
import { useDrag } from 'react-dnd'
import ReactDndDragPreviewImage from 'rc-dnd-preview-img'
// ....
const [{ isDragging }, drag, preview] = useDrag({
// begin: beginDrag,
// end: endDrag,
collect: (monitor) => {
// ....
return {
isDragging: !!monitor.isDragging(),
}
}
})
// ...
<DragPreivew connect={preview} src={rawImage} height={100} width={200} />