source: frontend/node_modules/react-app-polyfill/README.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 2.4 KB
Line 
1# react-app-polyfill
2
3This package includes polyfills for various browsers.
4It includes minimum requirements and commonly used language features used by [Create React App](https://github.com/facebook/create-react-app) projects.
5
6### Usage
7
8First, install the package using Yarn or npm:
9
10```sh
11npm install react-app-polyfill
12```
13
14or
15
16```sh
17yarn add react-app-polyfill
18```
19
20## Supporting Internet Explorer
21
22You 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 to use Create React App. For example, if you import the IE9 entry point, this will include IE10 and IE11 support.
23
24These modules ensure the following language features are present:
25
261. `Promise` (for `async` / `await` support)
271. `window.fetch` (a Promise-based way to make web requests in the browser)
281. `Object.assign` (a helper required for Object Spread, i.e. `{ ...a, ...b }`)
291. `Symbol` (a built-in object used by `for...of` syntax and friends)
301. `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._
33
34#### Internet Explorer 9
35
36```js
37// This must be the first line in src/index.js
38import 'react-app-polyfill/ie9';
39
40// ...
41```
42
43#### Internet Explorer 11
44
45```js
46// This must be the first line in src/index.js
47import 'react-app-polyfill/ie11';
48
49// ...
50```
51
52## Polyfilling other language features
53
54You 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
58import 'react-app-polyfill/stable';
59
60// ...
61```
62
63If you are supporting Internet Explorer 9 or Internet Explorer 11 you should include both the `ie9` or `ie11` and `stable` modules:
64
65For IE9:
66
67```js
68// These must be the first lines in src/index.js
69import 'react-app-polyfill/ie9';
70import 'react-app-polyfill/stable';
71
72// ...
73```
74
75For IE11:
76
77```js
78// These must be the first lines in src/index.js
79import 'react-app-polyfill/ie11';
80import 'react-app-polyfill/stable';
81
82// ...
83```
Note: See TracBrowser for help on using the repository browser.