You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: packages/react-app-polyfill/README.md
+46-13
Original file line number
Diff line number
Diff line change
@@ -3,18 +3,6 @@
3
3
This package includes polyfills for various browsers.
4
4
It includes minimum requirements and commonly used language features used by [Create React App](https://github.com/facebook/create-react-app) projects.
5
5
6
-
### Features
7
-
8
-
Each polyfill ensures the following language features are present:
9
-
10
-
1.`Promise` (for `async` / `await` support)
11
-
1.`window.fetch` (a Promise-based way to make web requests in the browser)
12
-
1.`Object.assign` (a helper required for Object Spread, i.e. `{ ...a, ...b }`)
13
-
1.`Symbol` (a built-in object used by `for...of` syntax and friends)
14
-
1.`Array.from` (a built-in static method used by array spread, i.e. `[...arr]`)
15
-
16
-
*If you need more features, you must include them manually.*
17
-
18
6
### Usage
19
7
20
8
First, install the package using Yarn or npm:
@@ -29,7 +17,19 @@ or
29
17
yarn add react-app-polyfill
30
18
```
31
19
32
-
Now, 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.
20
+
## Supporting Internet Explorer
21
+
22
+
You can import the entry point for the minimal version you intend to support to ensure that the minimum langauge features are present that are required to use Create React App. For example, if you import the IE9 entry point, this will include IE10 and IE11 support.
23
+
24
+
These modules ensures the following language features are present:
25
+
26
+
1.`Promise` (for `async` / `await` support)
27
+
1.`window.fetch` (a Promise-based way to make web requests in the browser)
28
+
1.`Object.assign` (a helper required for Object Spread, i.e. `{ ...a, ...b }`)
29
+
1.`Symbol` (a built-in object used by `for...of` syntax and friends)
30
+
1.`Array.from` (a built-in static method used by array spread, i.e. `[...arr]`)
31
+
32
+
_If you need more features, see the [Polyfilling other language features](#polyfilling-other-language-features) section below._
You can also polyfill stable language features not available in your target browsers. If you're using this in Create React App, it will automatically use the `browserslist` you've defined to only include polyfills needed by your target browsers when importing the `stable` polyfill. **Make sure to follow the Internet Explorer steps above if you need to support Internet Explorer in your application**.
55
+
56
+
```js
57
+
// This must be the first line in src/index.js
58
+
import'react-app-polyfill/stable';
59
+
60
+
// ...
61
+
```
62
+
63
+
If you are supporting Internet Explorer 9/11 you should include both the `ie9`/`ie11` and `stable` modules:
0 commit comments