import * as React from 'react'; import { DragDropContext, Droppable } from 'react-beautiful-dnd'; import './DraggableList.scss'; export interface DraggableListProps { children: React.ReactNode; className?: string; listId: string; onDragEnd: (sourceIndex: number, destinationIndex: number) => void; } const DraggableList = ({ children, className, listId, onDragEnd }: DraggableListProps) => { return ( { const destinationIndex = result.destination ? result.destination.index : result.source.index; return onDragEnd(result.source.index, destinationIndex); }} > {droppableProvided => (
{children}
)}
); }; export default DraggableList;