diff --git a/content/docs/reference-javascript-environment-requirements.md b/content/docs/reference-javascript-environment-requirements.md index 61854e90b38..c47cd37dc17 100644 --- a/content/docs/reference-javascript-environment-requirements.md +++ b/content/docs/reference-javascript-environment-requirements.md @@ -6,24 +6,13 @@ category: Reference permalink: docs/javascript-environment-requirements.html --- -React 16 depends on the collection types [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) and [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set). If you support older browsers and devices which may not yet provide these natively (e.g. IE < 11) or which have non-compliant implementations (e.g. IE 11), consider including a global polyfill in your bundled application, such as [core-js](https://github.com/zloirock/core-js). +React 18 supports all modern browsers (Edge, Firefox, Chrome, Safari, etc). -A polyfilled environment for React 16 using core-js to support older browsers might look like: +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. -```js -import 'core-js/es/map'; -import 'core-js/es/set'; +Here is a list of the modern features React 18 uses: +- [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) +- [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) +- [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) -import React from 'react'; -import ReactDOM from 'react-dom/client'; - -const root = ReactDOM.createRoot(document.getElementById('root')); -root.render(

Hello, world!

); -``` - -React also depends on `requestAnimationFrame` (even in test environments). -You can use the [raf](https://www.npmjs.com/package/raf) package to shim `requestAnimationFrame`: - -```js -import 'raf/polyfill'; -``` +The correct polyfill for these features depend on your environment. For many users, you can configure your [Browserlist](https://github.com/browserslist/browserslist) settings. For others, you may need to import polyfills like [`core-js`](https://github.com/zloirock/core-js) directly.