fix: 修复 key 重复
This commit is contained in:
@@ -469,13 +469,13 @@ const FlowingConcepts = () => {
|
||||
const row3 = concepts.slice(20, 30);
|
||||
|
||||
// 渲染单个概念卡片
|
||||
const renderConceptCard = (concept, globalIdx) => {
|
||||
const renderConceptCard = (concept, globalIdx, uniqueIdx) => {
|
||||
const colors = getColor(concept.change_pct);
|
||||
const isActive = hoveredIdx === globalIdx;
|
||||
|
||||
return (
|
||||
<Box
|
||||
key={globalIdx}
|
||||
key={`${globalIdx}-${uniqueIdx}`}
|
||||
flexShrink={0}
|
||||
px={3}
|
||||
py={2}
|
||||
@@ -582,7 +582,7 @@ const FlowingConcepts = () => {
|
||||
>
|
||||
{/* 复制两份实现无缝滚动 */}
|
||||
{[...items, ...items].map((concept, idx) =>
|
||||
renderConceptCard(concept, startIdx + (idx % items.length))
|
||||
renderConceptCard(concept, startIdx + (idx % items.length), idx)
|
||||
)}
|
||||
</Flex>
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user