React-dates: object.assign causes app failure in IE11 and Android

Created on 27 Apr 2017  路  2Comments  路  Source: airbnb/react-dates

object.assign on line 15 of lib/utils/getPhrasePropTypes.js causes IE11 to error out, because object.assign is not a method IE11 recognizes.

Looking at this document: http://kangax.github.io/compat-table/es6/#test-Object_static_methods_Object.assign
It looks as though the same will be true on most android browsers, though I haven't tested that yet.

Babel-polyfill: http://babeljs.io/docs/usage/polyfill/ is easy to use and fixes the issue, but I figured I'd make an issue just to point out that this component straight out of the box has the potential to break apps in (at least) IE11.

bug fixerefactoretc

Most helpful comment

It's definitely an easy fix, however there was nothing I saw in the docs about needing the shim package (it's not listed as a peer dependency, for instance) or a polyfill so I figured I'd mention it.

All 2 comments

You're expected to use https://npmjs.com/airbnb-browser-shims or the equivalent.

That said, we can use the object.assign package here and mitigate the issue.

It's definitely an easy fix, however there was nothing I saw in the docs about needing the shim package (it's not listed as a peer dependency, for instance) or a polyfill so I figured I'd mention it.

Was this page helpful?
0 / 5 - 0 ratings