Polyfills for various browsers including commonly used language features for React applications
npx @tessl/cli install tessl/npm-react-app-polyfill@3.0.0React App Polyfill provides essential browser polyfills specifically designed for React applications built with Create React App. The package enables modern JavaScript features to work in legacy browsers like Internet Explorer 9 and 11, offering targeted polyfill modules that automatically set up compatibility layers when imported.
npm install react-app-polyfillAll modules are imported as side-effects that automatically configure polyfills:
// For Internet Explorer 9 support
import 'react-app-polyfill/ie9';
// For Internet Explorer 11 support
import 'react-app-polyfill/ie11';
// For stable language features (modern browsers)
import 'react-app-polyfill/stable';
// For testing environments (jsdom/Node.js)
import 'react-app-polyfill/jsdom';CommonJS imports:
require('react-app-polyfill/ie9');
require('react-app-polyfill/ie11');
require('react-app-polyfill/stable');
require('react-app-polyfill/jsdom');React App Polyfill modules must be imported as the first lines in your application's entry point:
// These must be the first lines in src/index.js
import 'react-app-polyfill/ie11';
import 'react-app-polyfill/stable';
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(<App />, document.getElementById('root'));For Internet Explorer 9 support:
// These must be the first lines in src/index.js
import 'react-app-polyfill/ie9';
import 'react-app-polyfill/stable';
// ... rest of your application codeReact App Polyfill is built around side-effect modules that automatically configure browser polyfills:
Comprehensive polyfills for Internet Explorer 9 compatibility, including all IE11 features plus additional IE9-specific polyfills.
import 'react-app-polyfill/ie9';Polyfills Provided:
Essential polyfills for Internet Explorer 11 compatibility with modern JavaScript features.
import 'react-app-polyfill/ie11';Polyfills Provided:
Comprehensive polyfills for stable JavaScript language features. When used with Create React App, automatically configured based on your project's browserslist to include only necessary polyfills for target browsers.
import 'react-app-polyfill/stable';Polyfills Provided:
Minimal polyfills specifically designed for testing environments like jsdom and Node.js.
import 'react-app-polyfill/jsdom';Polyfills Provided:
For targeting a single browser compatibility level:
// IE9 support only
import 'react-app-polyfill/ie9';
// IE11 support only
import 'react-app-polyfill/ie11';
// Modern browsers with stable features
import 'react-app-polyfill/stable';For comprehensive browser support with both legacy and modern features:
// IE9 + stable features
import 'react-app-polyfill/ie9';
import 'react-app-polyfill/stable';
// IE11 + stable features
import 'react-app-polyfill/ie11';
import 'react-app-polyfill/stable';For test environments using jsdom:
// In test setup files
import 'react-app-polyfill/jsdom';React App Polyfill uses intelligent environment detection to apply polyfills only when appropriate:
typeof window !== 'undefined' prevents server-side polyfill loadingtypeof Promise === 'undefined' conditionally applies Promise polyfillThe package includes rejection tracking for Promises to prevent common React state inconsistencies: