Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

3 lat temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # react-app-polyfill
  2. This package includes polyfills for various browsers.
  3. It includes minimum requirements and commonly used language features used by [Create React App](https://github.com/facebook/create-react-app) projects.
  4. ### Features
  5. Each polyfill ensures the following language features are present:
  6. 1. `Promise` (for `async` / `await` support)
  7. 1. `window.fetch` (a Promise-based way to make web requests in the browser)
  8. 1. `Object.assign` (a helper required for Object Spread, i.e. `{ ...a, ...b }`)
  9. 1. `Symbol` (a built-in object used by `for...of` syntax and friends)
  10. 1. `Array.from` (a built-in static method used by array spread, i.e. `[...arr]`)
  11. ### Usage
  12. First, install the package using Yarn or npm:
  13. ```bash
  14. npm install react-app-polyfill
  15. ```
  16. or
  17. ```bash
  18. yarn add react-app-polyfill
  19. ```
  20. 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.
  21. #### Internet Explorer 9
  22. ```js
  23. // This must be the first line in src/index.js
  24. import 'react-app-polyfill/ie9';
  25. // ...
  26. ```
  27. #### Internet Explorer 11
  28. ```js
  29. // This must be the first line in src/index.js
  30. import 'react-app-polyfill/ie11';
  31. // ...
  32. ```