Files
grungnet/src/components/drag/Droppable.tsx
Mitchell McCaffrey ecfab87aa0 More typescript
2021-07-09 16:22:35 +10:00

24 lines
470 B
TypeScript

import React from "react";
import { useDroppable } from "@dnd-kit/core";
type DroppableProps = React.HTMLAttributes<HTMLDivElement> & {
id: string;
disabled: boolean;
};
function Droppable({ id, children, disabled, ...props }: DroppableProps) {
const { setNodeRef } = useDroppable({ id, disabled });
return (
<div ref={setNodeRef} {...props}>
{children}
</div>
);
}
Droppable.defaultProps = {
disabled: false,
};
export default Droppable;