@computerrock/react-app-polyfill
v2.0.0
Published
Polyfills for commonly used language features
Downloads
134
Keywords
Readme
@computerrock/react-app-polyfill
This package provides polyfills for commonly used language features. It is based on Create React App package.
Usage
Install package by running:
npm install @computerrock/react-app-polyfill
Polyfilling language features
You can polyfill stable language features not available in your target browsers:
// must be the first line in src/index.js
import 'react-app-polyfill/stable';
// ...
Supporting Internet Explorer
These modules ensure the following language features are present:
Promise
(forasync
/await
support)window.fetch
(a Promise-based way to make web requests in the browser)Object.assign
(a helper required for Object Spread, i.e.{ ...a, ...b }
)Symbol
(a built-in object used byfor...of
syntax and friends)Array.from
(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:
// This must be the first line in src/index.js
import 'react-app-polyfill/ie11';
import 'react-app-polyfill/stable';
// ...
or:
// This must be the first line in src/index.js
import 'react-app-polyfill/ie9';
import 'react-app-polyfill/stable';
// ...