JavaScript 環境要求
<<<<<<< HEAD React 16 依賴 Map 和 Set 集合類型。如果你需要支援舊瀏覽器和設備,它們原生並沒有支援(例如 IE < 11)或是沒有兼容的實作(例如 IE 11),請考慮於應用程式加入一個全域的 polyfill,例如 core-js
使用 core-js 支援舊瀏覽器的 React 16 的 polyfill 環境大致如下:
React 18 supports all modern browsers (Edge, Firefox, Chrome, Safari, etc).
If you support older browsers and devices such as Internet Explorer which do not provide modern browser features natively or have non-compliant implementations, consider including a global polyfill in your bundled application.
707f22d25f5b343a2e5e063877f1fc97cb1f48a1
Here is a list of the modern features React 18 uses:
<<<<<<< HEAD import React from ‘react’; import ReactDOM from ‘react-dom’;
ReactDOM.render(
Hello, world!
, document.getElementById('root') ); ```React 也依賴 requestAnimationFrame
(即使在測試環境)。
你可以使用raf package 去 shim requestAnimationFrame
:
import 'raf/polyfill';
=======
The correct polyfill for these features depend on your environment. For many users, you can configure your Browserlist settings. For others, you may need to import polyfills like core-js
directly.
707f22d25f5b343a2e5e063877f1fc97cb1f48a1