20 lines
381 B
TypeScript
20 lines
381 B
TypeScript
import React from "react";
|
|
import { useDroppable } from "@dnd-kit/core";
|
|
|
|
function Droppable(props: any) {
|
|
const { isOver, setNodeRef } = useDroppable({
|
|
id: "droppable",
|
|
});
|
|
const style = {
|
|
color: isOver ? "green" : undefined,
|
|
};
|
|
|
|
return (
|
|
<div ref={setNodeRef} className={props.className}>
|
|
{props.children}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default Droppable;
|