Skip to content

Instantly share code, notes, and snippets.

@jubalm
Last active February 3, 2020 15:15
Show Gist options
  • Save jubalm/c7b9d891e4b5cf4c860a27713b68819f to your computer and use it in GitHub Desktop.
Save jubalm/c7b9d891e4b5cf4c860a27713b68819f to your computer and use it in GitHub Desktop.
Create React App IE support

Edit package.json file to include these browserslist configuration

{
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

Install react-app-polyfill

npm install react-app-polyfill

or if using yarn

yarn add react-app-polyfill

Import the polyfill to src/index.js

import "react-app-polyfill/ie11"; // according to supported IE version
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';

// rest of file...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment