Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function DragLayer() {
const { item, itemType, currentOffset, isDragging } = useDragLayer(monitor => ({
item: monitor.getItem(),
itemType: monitor.getItemType(),
currentOffset: monitor.getClientOffset(),
isDragging: monitor.isDragging()
}));
if (!isDragging || !currentOffset) {
return null;
}
let preview;
if (itemType === ItemTypes.Node) {
if (item.multiple) {
preview = <div>{`${item.value.length} Nodes Selected`}</div>;
} else {