From 10d9ffc740ebd8387f02ab59da396a4e276cff2a Mon Sep 17 00:00:00 2001 From: ajnart Date: Mon, 23 May 2022 10:44:31 +0200 Subject: [PATCH] :rotating_light: Fix compilation for types --- src/components/dnd.tsx | 2 +- src/pages/trynewdnd.tsx | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/dnd.tsx b/src/components/dnd.tsx index 4c963bc79..e41390abf 100644 --- a/src/components/dnd.tsx +++ b/src/components/dnd.tsx @@ -66,7 +66,7 @@ export function DndList({ data }: DndListProps) { return ( - handlers.reorder({ from: source.index, to: destination.index }) + handlers.reorder({ from: source.index, to: (destination && destination.index) ?? -1 }) } > diff --git a/src/pages/trynewdnd.tsx b/src/pages/trynewdnd.tsx index effb3ab5f..7de52d989 100644 --- a/src/pages/trynewdnd.tsx +++ b/src/pages/trynewdnd.tsx @@ -13,7 +13,6 @@ import { Grid } from '@mantine/core'; import { SortableItem } from '../components/dnd/StorableItem'; import { AppShelfItem } from '../components/AppShelf/AppShelf'; import { useConfig } from '../tools/state'; -import { Config } from '../tools/types'; export default function App() { const [activeId, setActiveId] = useState(null); @@ -49,13 +48,13 @@ export default function App() { ); - function handleDragStart(event) { + function handleDragStart(event: any) { const { active } = event; setActiveId(active.id); } - function handleDragEnd(event) { + function handleDragEnd(event: any) { const { active, over } = event; if (active.id !== over.id) {