Array.prototype.includes is not transpiled not sure if this a problem with a babel setting here or a problem with babel itself. But this break IE.
Related to https://github.com/facebookincubator/create-react-app/issues/914, CRA purposely doesn't bring in a lot of polyfills, and Array.prototype.includes has to be polyfilled on IE
@EnoahNetzach I would say that a polyfill is not necessary, you could transpile array.includes(i) to array.indexOf(i) !== -1
Edit: Oops, I see now that this is hard to transpile, because you have to know that array is an Array.
Polyfills are defined in packages/react-scripts/config/polyfills.js. Looks like there's no support for array.includes at this moment.
@gaearon said in https://github.com/facebookincubator/create-react-app/issues/170 that more polyfills can be added in the future.
I believe Array.prototype.includes would be a good one to include by default.
Closing in favor of #969: we need to document available polyfills.
We don't intend to include most of the ES polyfills by default.
Most helpful comment
@gaearon said in https://github.com/facebookincubator/create-react-app/issues/170 that more polyfills can be added in the future.
I believe
Array.prototype.includeswould be a good one to include by default.