Skip to content

Commit

Permalink
Fix list key warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJamesC committed Sep 12, 2023
1 parent ed05039 commit bcae047
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion reports/src/capability/ChildCapabilityTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const ChildCapabilityTable = ({
capability: Capability;
}) => {
const childCapabilities = capability.childCapabilities.map((c, i) => (
<ChildCapabilityRow capability={c} path={i.toString()} />
<ChildCapabilityRow key={c.name} capability={c} path={i.toString()} />
));

if (!childCapabilities.length) {
Expand Down
8 changes: 4 additions & 4 deletions reports/src/capability/RequirementTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ const CheckAggregateRow = ({ checks }: { checks: Check[] }) => {
</AccordionSummary>
<AccordionDetails>
<Box sx={{ display: "flex", gap: 1, flexWrap: "wrap" }}>
{checks.map((c) => (
<CheckStatusTag check={c} />
{checks.map((c, i) => (
<CheckStatusTag check={c} key={i} />
))}
</Box>
</AccordionDetails>
Expand Down Expand Up @@ -127,14 +127,14 @@ const checkAggregatedRows = (requirement: Requirement) => {
return Object.keys(aggregatedChecks)
.map((key) => {
const checks = aggregatedChecks[key];
return <CheckAggregateRow checks={checks} />;
return <CheckAggregateRow key={key} checks={checks} />;
})
.flat();
};
const requirementRow = (requirement: Requirement) => {
const checks = checkAggregatedRows(requirement);
const requirementHeader = (
<TableRow>
<TableRow key={requirement.name}>
<TableCell rowSpan={checks.length + 1}>{requirement.name}</TableCell>
{!checks.length && <TableCell>Not tested</TableCell>}
</TableRow>
Expand Down

0 comments on commit bcae047

Please sign in to comment.