Skip to content

Commit

Permalink
fix(gatsby): with some custom babel configs array spreading with Set …
Browse files Browse the repository at this point in the history
…is not safe (#29885)
  • Loading branch information
pieh committed Mar 1, 2021
1 parent d14cdc5 commit 5d312fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ function WrappedAccordionItem({ error, open }) {
}

export function GraphqlErrors({ errors, dismiss }) {
const deduplicatedErrors = React.useMemo(() => [...new Set(errors)], [errors])
const deduplicatedErrors = React.useMemo(() => Array.from(new Set(errors)), [
errors,
])
const hasMultipleErrors = deduplicatedErrors.length > 1
return (
<Overlay>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ function WrappedAccordionItem({ error, open }) {
}

export function RuntimeErrors({ errors, dismiss }) {
const deduplicatedErrors = React.useMemo(() => [...new Set(errors)], [errors])
const deduplicatedErrors = React.useMemo(() => Array.from(new Set(errors)), [
errors,
])
const hasMultipleErrors = deduplicatedErrors.length > 1

return (
Expand Down

0 comments on commit 5d312fe

Please sign in to comment.