We want to hear from you!Take our 2020 Community Survey!

דרישות סביבת JavaScript

React 16 תלוי באוסף הטיפוסים Map ו-Set. אם אתה תומך בדפדפנים ישנים יותר ומכשירים אשר עדיין לא מספקים אותם (לדוגמה, IE < 11) או אשר אין להם מימושים תואמים (IE 11), שקול להוסיף polyfill גלובלי לאפליקציה הארוזה שלך, כמו core-js.

סביבת polyfilled ל-React 16 עם שימוש ב-core-js כדי לתמוך בדפדפנים ישנים עשוייה להראות כך:

import 'core-js/es/map';
import 'core-js/es/set';

import React from 'react';
import ReactDOM from 'react-dom';

ReactDOM.render(
  <h1>Hello, world!</h1>,
  document.getElementById('root')
);

React גם תלוי ב-requestAnimationFrame (אפילו בסביבות בדיקה).
אתה יכול להשתמש בספריית raf כדי לתמוך ב-requestAnimationFrame:

import 'raf/polyfill';
Is this page useful?ערוך עמוד זה