You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
424 B
21 lines
424 B
import * as React from 'react';
|
|
/*
|
|
* A utility for rendering a drag preview image
|
|
*/
|
|
|
|
export var DragPreviewImage = React.memo(function (_ref) {
|
|
var connect = _ref.connect,
|
|
src = _ref.src;
|
|
|
|
if (typeof Image !== 'undefined') {
|
|
var img = new Image();
|
|
img.src = src;
|
|
|
|
img.onload = function () {
|
|
return connect(img);
|
|
};
|
|
}
|
|
|
|
return null;
|
|
});
|
|
DragPreviewImage.displayName = 'DragPreviewImage'; |