This package includes polyfills for various browsers.
It includes minimum requirements and commonly used language features used by Create React App projects.
Please refer to its documentation:
- Getting Started – How to create a new app.
- User Guide – How to develop apps bootstrapped with Create React App.
Each polyfill ensures 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. For example, if you import the IE9 entry point, this will include IE10 and IE11 support.
// This must be the first line in src/index.js
import 'react-app-polyfill/ie9';
// ...
// This must be the first line in src/index.js
import 'react-app-polyfill/ie11';
// ...