Image is not uploaded when you call setDragImage(). I processed this by creating an image on a mount and keeping it in a state:
componentDidMount() {
const img = new Image();
img.src = 'https://some-image.png';
img.onload = () => this.setState({ dragImg: img });
}
drag(e) {
e.dataTransfer.setDragImage(this.state.dragImg, 0, 0);
}
Sauce source
share