With the release of Create React App 3.0 and the addition of browserlist, adding support for IE 11 is trivial, but the steps can be hard to find if you don't know where to look. The documentation lists "Supported Browsers" and shows the default browserslist configuration ( https://facebook.github.io/create-react-app/docs/supported-browsers-features ) but that isn't all you need to know.
Checking browserl.ist with the production settings you'll see IE 11 has greater usage than Edge still ( https://browserl.ist/?q=%3E0.2%25%2C+not+dead%2C+not+op_mini+all ) With a default CRA 3 app you'll get Syntax Error in main.chunk.js and other errors in your app with IE 11.
Supported Browsers By default, the generated project supports all modern browsers. Support for Internet Explorer 9, 10, and 11 requires polyfills. For a set of polyfills to support older browsers, use react-app-polyfill.
React 18 supports all modern browsers (Edge, Firefox, Chrome, Safari, etc). 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.
To stop the errors and get a default create-react-app React application working in IE 11:
npx create-react-app [AppName]
import 'react-app-polyfill/ie11';
to the VERY top of index.jsimport 'react-app-polyfill/stable';
just below the first line in index.jsIE 11 is a nightmare. There are some things that will probably solve the problem:
react-app-polyfill
you may update the main things which is a great point to start. The documentation is very straight forward to implement: https://github.com/facebook/create-react-app/tree/master/packages/react-app-polyfill.babel-plugin-transform-arrow-functions
is your best solution for this. It is very nicely explained in the documentation: https://babeljs.io/docs/en/babel-plugin-transform-arrow-functions.browserslist
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With