1.0.1 • Published 11 months ago

rc-dnd-preview-img v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

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} />
1.0.1

11 months ago

1.0.0

11 months ago