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