Skip to content

Commit

Permalink
Fixed React key warning on GraphQL error notices (#7121)
Browse files Browse the repository at this point in the history
  • Loading branch information
moselhy authored and dcousens committed May 11, 2022
1 parent af3432a commit 20095f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-turkeys-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-6/core': patch
---

Fixed React key warning when showing GraphQL errors
6 changes: 4 additions & 2 deletions packages/core/src/admin-ui/components/GraphQLErrorNotice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ export function GraphQLErrorNotice({ errors, networkError }: GraphQLErrorNoticeP
if (errors?.length) {
return (
<Stack gap="small" marginBottom="large">
{errors.map(err => (
<Notice tone="negative">{err.message}</Notice>
{errors.map((err, idx) => (
<Notice tone="negative" key={idx}>
{err.message}
</Notice>
))}
</Stack>
);
Expand Down

0 comments on commit 20095f0

Please sign in to comment.