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) (#29889)

(cherry picked from commit 5d312fe)

Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
  • Loading branch information
GatsbyJS Bot and pieh committed Mar 1, 2021
1 parent ea31900 commit 222ca3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
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
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 222ca3f

Please sign in to comment.