Skip to content

Commit

Permalink
fix: add key to all mapped components
Browse files Browse the repository at this point in the history
  • Loading branch information
keplersj committed Oct 10, 2019
1 parent 7f9949b commit cd1d2e8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/Card/index.tsx
Expand Up @@ -44,7 +44,9 @@ export const Card = (props: Props) => {
<CardActions>
<Grid container direction="column" wrap="nowrap">
{props.links.map(link => (
<Button href={link.url}>{link.name}</Button>
<Button key={link.name} href={link.url}>
{link.name}
</Button>
))}
</Grid>
</CardActions>
Expand Down
1 change: 1 addition & 0 deletions src/components/Consumers/index.tsx
Expand Up @@ -27,6 +27,7 @@ const Consumers = () => {
<Grid container justify="space-evenly">
{sortBy(data.consumers.edges, "node.title").map(({ node }: any) => (
<Card
key={node.id}
title={node.title}
subtitle={`Maintained by ${node.author}`}
links={[
Expand Down
2 changes: 1 addition & 1 deletion src/components/Nav/index.tsx
Expand Up @@ -113,7 +113,7 @@ const Nav = () => {
</Typography>
<Hidden only={["xs", "sm"]}>
{data.site.siteMetadata.nav.map(link => (
<Button color="inherit" href={link.url}>
<Button key={link.name} color="inherit" href={link.url}>
{link.name}
</Button>
))}
Expand Down
1 change: 1 addition & 0 deletions src/components/Providers/index.tsx
Expand Up @@ -55,6 +55,7 @@ const Providers = () => {
<Grid container justify="space-evenly">
{sortBy(scope.types, "title").map(type => (
<Card
key={type.title}
title={type.title}
links={type.packages.map(pkg => ({
name: pkg.title,
Expand Down

0 comments on commit cd1d2e8

Please sign in to comment.