rc-dnd-preview-image

1.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i rc-dnd-preview-image

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

5.47 kB

Total Files

5

Last publish

Collaborators

  • tim66