Skip to content

Commit bb8c276

Browse files
committed
Add a react key for treats
1 parent 3f7562a commit bb8c276

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dotcom-rendering/src/components/Treats.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ export const Treats = ({
172172
borderColour?: string;
173173
}) => {
174174
if (treats.length === 0) return null;
175+
175176
return (
176177
<ul
177178
css={css`
@@ -181,6 +182,7 @@ export const Treats = ({
181182
>
182183
{treats.map((treat, index) => {
183184
const [link] = treat.links;
185+
184186
if (link?.linkTo === '/crosswords' && link.text) {
185187
// Treats that link to /crosswords are special. If any
186188
// treat has this exact url then an svg of a crossword
@@ -229,7 +231,7 @@ export const Treats = ({
229231
}
230232

231233
return (
232-
<>
234+
<Fragment key={index}>
233235
{treat.links.map(({ text, linkTo }) => (
234236
<TextTreat
235237
key={linkTo}
@@ -239,7 +241,7 @@ export const Treats = ({
239241
borderColour={borderColour}
240242
/>
241243
))}
242-
</>
244+
</Fragment>
243245
);
244246
})}
245247
</ul>

0 commit comments

Comments
 (0)