From 57ed732ba82aea5db400cd80cab76d251413965e Mon Sep 17 00:00:00 2001 From: Robin Date: Wed, 29 Nov 2023 10:49:17 -0500 Subject: [PATCH] Fix type errors --- src/video-grid/VideoGrid.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/video-grid/VideoGrid.tsx b/src/video-grid/VideoGrid.tsx index 59cf78a7..2d71cea0 100644 --- a/src/video-grid/VideoGrid.tsx +++ b/src/video-grid/VideoGrid.tsx @@ -16,7 +16,6 @@ limitations under the License. import { ComponentProps, - Key, MutableRefObject, ReactNode, Ref, @@ -801,7 +800,7 @@ function reorderTiles( interface DragTileData { offsetX: number; offsetY: number; - key: Key; + key: string; x: number; y: number; } @@ -861,7 +860,7 @@ export function VideoGrid({ }); const [scrollPosition, setScrollPosition] = useState(0); const draggingTileRef = useRef(null); - const lastTappedRef = useRef<{ [index: Key]: number }>({}); + const lastTappedRef = useRef<{ [index: string]: number }>({}); const lastLayoutRef = useRef(layout); const isMounted = useIsMounted(); @@ -876,7 +875,7 @@ export function VideoGrid({ useEffect(() => { setTileState(({ tiles, ...rest }) => { const newTiles: Tile[] = []; - const removedTileKeys: Set = new Set(); + const removedTileKeys: Set = new Set(); for (const tile of tiles) { let item = items.find((item) => item.id === tile.key); @@ -1138,7 +1137,7 @@ export function VideoGrid({ ]) as unknown as [SpringValues[], SpringRef]; const onTap = useCallback( - (tileKey: Key) => { + (tileKey: string) => { const lastTapped = lastTappedRef.current[tileKey]; if (!lastTapped || Date.now() - lastTapped > 500) {