Skip to content

Commit

Permalink
Improve key attributes for array components
Browse files Browse the repository at this point in the history
  • Loading branch information
WillBAnders committed Dec 13, 2023
1 parent 53b5a31 commit 3e46aee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/about/officer-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type OfficerCardProps = {

export default function OfficerCard({ position, officer }: OfficerCardProps) {
const socialLinks = Object.entries(officer.socials).map(([site, url]) => (
<a href={url} key={site} target="_blank" rel="noopener noreferrer">
<a key={site} href={url} target="_blank" rel="noopener noreferrer">
<Image
src={socialIcons[site as SocialSite]} // cast key from Object.entries
alt={site}
Expand Down
6 changes: 1 addition & 5 deletions src/app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ export default function About() {
const officerCards = Object.entries(officers).map(
([position, officer]) => {
return (
<OfficerCard
key={`${semester} ${position}`}
position={position}
officer={officer}
/>
<OfficerCard key={position} position={position} officer={officer} />
);
},
);
Expand Down

0 comments on commit 3e46aee

Please sign in to comment.