diff --git a/src/react/VList.tsx b/src/react/VList.tsx index b7bb38ceb..e0d39c3f4 100644 --- a/src/react/VList.tsx +++ b/src/react/VList.tsx @@ -296,22 +296,20 @@ export const VList = forwardRef( const items = useMemo(() => { const res: ReactElement[] = []; for (let i = overscanedStartIndex; i <= overscanedEndIndex; i++) { - const e = elements[i]; - // This can be undefined when items are removed - if (exists(e)) { - res.push( - - ); - } + const e = elements[i]!; + const key = (e as MayHaveKey).key; + res.push( + + ); } return res; }, [elements, overscanedStartIndex, overscanedEndIndex]); diff --git a/src/react/WVList.tsx b/src/react/WVList.tsx index 03392011f..a06c6fc80 100644 --- a/src/react/WVList.tsx +++ b/src/react/WVList.tsx @@ -232,22 +232,20 @@ export const WVList = forwardRef( const items = useMemo(() => { const res: ReactElement[] = []; for (let i = overscanedStartIndex; i <= overscanedEndIndex; i++) { - const e = elements[i]; - // This can be undefined when items are removed - if (exists(e)) { - res.push( - - ); - } + const e = elements[i]!; + const key = (e as MayHaveKey).key; + res.push( + + ); } return res; }, [elements, overscanedStartIndex, overscanedEndIndex]);