Polyfills for commonly used language features
npm install @computerrock/react-app-polyfillThis package provides polyfills for commonly used language features. It is based on Create React App
package.
Install package by running:
``sh`
npm install @computerrock/react-app-polyfill
You can polyfill stable language features not available in your target browsers:
`js
// must be the first line in src/index.js
import 'react-app-polyfill/stable';
// ...
`
These modules ensure the following language features are present:
1. Promise (for async / await support)window.fetch
1. (a Promise-based way to make web requests in the browser)Object.assign
1. (a helper required for Object Spread, i.e. { ...a, ...b })Symbol
1. (a built-in object used by for...of syntax and friends)Array.from
1. (a built-in static method used by array spread, i.e. [...arr])
You can import the entry point for the minimal version you intend to support to ensure that
the minimum language features are present that are required:
`js
// This must be the first line in src/index.js
import 'react-app-polyfill/ie11';
import 'react-app-polyfill/stable';
// ...
`
or:
`js
// This must be the first line in src/index.js
import 'react-app-polyfill/ie9';
import 'react-app-polyfill/stable';
// ...
``