Skip to content

Conversation

@pieh
Copy link
Contributor

@pieh pieh commented Mar 1, 2021

Description

With some custom .babelrc configs those can result in wrong transpiled code:

  var deduplicatedErrors = react__WEBPACK_IMPORTED_MODULE_6__.useMemo(function () {
    return [].concat(new Set(errors));
  }, [errors]);

Array.from does same thing without above:

  var deduplicatedErrors = react__WEBPACK_IMPORTED_MODULE_6__.useMemo(function () {
    return Array.from(new Set(errors));
  }, [errors]);

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 1, 2021
@LekoArts LekoArts added topic: hot reloading and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Mar 1, 2021
Copy link
Contributor

@vladar vladar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 🙏

@vladar vladar merged commit 5d312fe into master Mar 1, 2021
@vladar vladar deleted the v3/array-spread-with-set-not-always-safe branch March 1, 2021 18:17
vladar pushed a commit that referenced this pull request Mar 1, 2021
vladar pushed a commit that referenced this pull request Mar 1, 2021
…is not safe (#29885) (#29889)

(cherry picked from commit 5d312fe)

Co-authored-by: Michal Piechowiak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: DX Developer Experience (e.g. Fast Refresh, i18n, SSR, page creation, starters)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants