Skip to content

Commit d086d49

Browse files
committed
[18] Update browser requirements (#4476)
* [18] Update browser requirements * Update based on feedback
1 parent a78fdc3 commit d086d49

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

content/docs/reference-javascript-environment-requirements.md

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,13 @@ category: Reference
66
permalink: docs/javascript-environment-requirements.html
77
---
88

9-
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).
9+
React 18 supports all modern browsers (Edge, Firefox, Chrome, Safari, etc).
1010

11-
A polyfilled environment for React 16 using core-js to support older browsers might look like:
11+
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.
1212

13-
```js
14-
import 'core-js/es/map';
15-
import 'core-js/es/set';
13+
Here is a list of the modern features React 18 uses:
14+
- [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
15+
- [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol)
16+
- [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
1617

17-
import React from 'react';
18-
import ReactDOM from 'react-dom/client';
19-
20-
const root = ReactDOM.createRoot(document.getElementById('root'));
21-
root.render(<h1>Hello, world!</h1>);
22-
```
23-
24-
React also depends on `requestAnimationFrame` (even in test environments).
25-
You can use the [raf](https://www.npmjs.com/package/raf) package to shim `requestAnimationFrame`:
26-
27-
```js
28-
import 'raf/polyfill';
29-
```
18+
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.

0 commit comments

Comments
 (0)