---
title: "Comment by JimmyLv_吕立青 on \"Setting Up React, Webpack 4 & Babel 7 from scratch — 2021\" | Hashnode"
description: "Do we still need @babel/runtime and @babel/plugin-transform-runtime if we need to use (Iterator、Generator、Set、Maps、Proxy、Reflect、Symbol、Promise、Object.assign) t"
url: "https://hashnode.com/posts/setting-up-react-webpack-4-and-babel-7-from-scratch-2021/5f99b977ae41043093cdb86d/comment/5f9a67a7ae41043093cdbfef"
---

[Discussion](https://hashnode.com/posts/setting-up-react-webpack-4-and-babel-7-from-scratch-2021/5f99b977ae41043093cdb86d)

Comment [Setting Up React, Webpack 4 & Babel 7 from scratch — 2021](https://hashnode.com/posts/setting-up-react-webpack-4-and-babel-7-from-scratch-2021/5f99b977ae41043093cdb86d)

[JimmyLv\_吕立青](https://hashnode.com/@jimmylv)

[Oct 29, 2020](https://hashnode.com/posts/setting-up-react-webpack-4-and-babel-7-from-scratch-2021/5f99b977ae41043093cdb86d/comment/5f9a67a7ae41043093cdbfef)

Do we still need @babel/runtime and @babel/plugin-transform-runtime if we need to use (Iterator、Generator、Set、Maps、Proxy、Reflect、Symbol、Promise、Object.assign) the new JavaScript Syntax after applying @babel/preset-env?

[Jay Desai](https://hashnode.com/@desaijay)

[Oct 29, 2020](https://hashnode.com/posts/setting-up-react-webpack-4-and-babel-7-from-scratch-2021/5f99b977ae41043093cdb86d/comment/5f9a67a7ae41043093cdbfef#reply-5f9a7ec41646ee3072b6e563)

Hey [吕立青](https://hashnode.com/@jimmylv), Great question. We need to use @babel/preset-env which transforms syntax. We need to use @babel/transform-runtime to avoid duplicate code, and config core-js: 3 to polyfill.

babel-plugin-transform-runtime automatically injects Regenerator where generators or async/await are used.

So, installing babel/runtime and @babel/plugin-transform-runtime will solve your problem.

So, what you can do is,

```
yarn add @babel/plugin-transform-runtime --dev
yarn add @babel/runtime
```

and in .babelrc, you can add this plugin.

```
"plugins": [
    ["@babel/plugin-transform-runtime",
      {
        "regenerator": true
      }
    ]
  ]
```

**By default regenerator is true**
