Skip to content

Commit f98e9da

Browse files
committed
Fix up some React keys in Flexible General
1 parent 058d2da commit f98e9da

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

dotcom-rendering/src/components/FlexibleGeneral.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ const ImmersiveCardLayout = ({
105105
const isLoopingVideo = card.mainMedia?.type === 'LoopVideo';
106106

107107
return (
108-
<UL padBottom={true}>
109-
<LI key={card.url} padSides={true}>
108+
<UL padBottom={true} key={card.url}>
109+
<LI padSides={true}>
110110
<FeatureCard
111111
collectionId={collectionId}
112112
linkTo={card.url}
@@ -447,6 +447,7 @@ const FullWidthCardLayout = ({
447447
showTopBar={!isFirstRow}
448448
padBottom={!isLastRow}
449449
hasLargeSpacing={!isLastRow}
450+
key={card.url}
450451
>
451452
<LI
452453
padSides={true}
@@ -501,6 +502,7 @@ const HalfWidthCardLayout = ({
501502
isFirstRow,
502503
isFirstStandardRow,
503504
aspectRatio,
505+
row,
504506
isLastRow,
505507
containerLevel,
506508
isInHideTrailsAbTest,
@@ -513,6 +515,7 @@ const HalfWidthCardLayout = ({
513515
showAge?: boolean;
514516
absoluteServerTimes: boolean;
515517
aspectRatio: AspectRatio;
518+
row: number;
516519
isLastRow: boolean;
517520
containerLevel: DCRContainerLevel;
518521
isInHideTrailsAbTest?: boolean;
@@ -527,6 +530,7 @@ const HalfWidthCardLayout = ({
527530
showTopBar={!isFirstRow}
528531
/** We use one full top bar for the first row and use a split one for subsequent rows */
529532
splitTopBar={!isFirstStandardRow}
533+
key={row}
530534
>
531535
{cards.map((card, cardIndex) => {
532536
return (
@@ -642,6 +646,7 @@ export const FlexibleGeneral = ({
642646
isFirstRow={!splash.length && i === 0}
643647
isFirstStandardRow={i === 0}
644648
aspectRatio={aspectRatio}
649+
row={i + 1}
645650
isLastRow={i === groupedCards.length - 1}
646651
containerLevel={containerLevel}
647652
isInHideTrailsAbTest={isInHideTrailsAbTest}

0 commit comments

Comments
 (0)