fix(board): add computeItemKey to Virtuoso to prevent media flash on page change

Without `computeItemKey`, Virtuoso uses index-based keys so React reuses DOM nodes across pages, causing `<img>` elements to briefly flash old media before loading new sources.
This commit is contained in:
plebeius
2026-02-23 20:24:37 +08:00
parent 0ea7356523
commit 849ff18a8b
+1
View File
@@ -350,6 +350,7 @@ const Board = ({ feedCacheKey, viewType, boardIdentifier: boardIdentifierProp, i
increaseViewportBy={{ bottom: 1200, top: 1200 }}
totalCount={displayFeed.length}
data={displayFeed}
computeItemKey={(index, post) => post?.cid || `post-${index}`}
itemContent={(index, post) => <Post index={index} post={post} />}
useWindowScroll={true}
components={footerComponents}