react-sortable
react-sortable copied to clipboard
Typescript Definition File
Can you please include a typescript definition file?
I whipped this together for anyone looking for a quick hack:
declare module 'react-sortable' {
export function sortable<ItemType, BaseProps = {}>( component: React.FC<BaseProps> )
: React.FC<BaseProps & SortableProps<ItemType>>;
}
interface SortableProps<ItemType> {
onSortItems: ( items: ItemType[] ) => void;
items: ItemType[];
sortId: number;
key: number | string;
}
This goes into a file such as react-sortable.d.ts and should work from there.