5

I use babel-polyfill in my React app to transpile ECMAScript to vanilla JS. I understand babel-polyfill is now deprecated.

The warning I get in my React app is:

@babel/polyfill is deprecated. Please, use required parts of core-js and regenerator-runtime/runtime separately

I currently have the following in my package.json file:

"devDependencies": {
    "babel-polyfill": "^6.26.0",
    "redux-devtools": "^3.5.0"
  }

Is it safe to assume that I'll need to have the following now instead of babel-polyfill?

"devDependencies": {
    "core-js": "3.6.5",
    "regenerator-runtime": "0.13.5"
  },

Also, I think, instead of import 'babel-polyfill'; in my reducers and components, I think I'll need the following:

import "core-js/stable";
import "regenerator-runtime/runtime";

Are these the steps to go through? Am I missing anything?

Sam
  • 26,817
  • 58
  • 206
  • 383