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.
14 lines
369 B
14 lines
369 B
import * as React from 'react';
|
|
/*
|
|
* A utility for rendering a drag preview image
|
|
*/
|
|
export const DragPreviewImage = React.memo(({ connect, src }) => {
|
|
if (typeof Image !== 'undefined') {
|
|
const img = new Image();
|
|
img.src = src;
|
|
img.onload = () => connect(img);
|
|
}
|
|
return null;
|
|
});
|
|
DragPreviewImage.displayName = 'DragPreviewImage';
|