From b64ca8b300f2bcbbbcbdf95b4e0d9780c1f64b1b Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Tue, 27 Aug 2024 22:50:31 +0800 Subject: [PATCH] fix: fix some case(maybe) can not key problem --- src/client/routes/feed/$channelId/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/routes/feed/$channelId/index.tsx b/src/client/routes/feed/$channelId/index.tsx index 3aef7d9..1cc441b 100644 --- a/src/client/routes/feed/$channelId/index.tsx +++ b/src/client/routes/feed/$channelId/index.tsx @@ -16,7 +16,7 @@ import { DialogWrapper } from '@/components/DialogWrapper'; import { useSocketSubscribeList } from '@/api/socketio'; import { useMemo } from 'react'; import { DynamicVirtualList } from '@/components/DynamicVirtualList'; -import { reverse } from 'lodash-es'; +import { get, reverse } from 'lodash-es'; export const Route = createFileRoute('/feed/$channelId/')({ beforeLoad: routeAuthBeforeLoad, @@ -127,7 +127,7 @@ function PageComponent() { hasNextPage={hasNextPage} isFetchingNextPage={isFetchingNextPage} onFetchNextPage={fetchNextPage} - getItemKey={(index) => fullEvents[index].id} + getItemKey={(index) => get(fullEvents, [index, 'id'])} renderItem={(item) => ( )}