From 588c6d7feca7341d060ac0ea4f5c218912375224 Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Thu, 26 Nov 2020 16:21:41 +0300 Subject: [PATCH] Fixing uid condition Signed-off-by: Alex Andreev --- src/renderer/components/virtual-list/virtual-list.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/virtual-list/virtual-list.tsx b/src/renderer/components/virtual-list/virtual-list.tsx index 607b9c3702..4175c50474 100644 --- a/src/renderer/components/virtual-list/virtual-list.tsx +++ b/src/renderer/components/virtual-list/virtual-list.tsx @@ -13,8 +13,8 @@ import debounce from "lodash/debounce"; import isEqual from "lodash/isEqual"; import ResizeSensor from "css-element-queries/src/ResizeSensor"; -interface Props { - items: any[]; +interface Props { + items: T[]; rowHeights: number[]; className?: string; width?: number | string; @@ -126,7 +126,7 @@ interface RowProps extends ListChildComponentProps { const Row = observer((props: RowProps) => { const { index, style, data } = props; const { items, getRow } = data; - const uid = items[index].getId ? items[index].getId() : index; + const uid = items[index]?.getId ? items[index].getId() : index; const row = getRow(uid); if (!row) return null; return React.cloneElement(row, {