I've made a simple demo app here: https://github.com/majapw/react-dates-demo/pull/3
It appears that our baseClass (https://github.com/airbnb/react-dates/blob/master/src/utils/baseClass.js) errors out in IE10 when an HOC-wrapped component extends it. It does not cause any problems when a non-wrapped component extends it.
to: @ljharb @noratarano @lencioni @AntiFish03
The second commit (which inlines the check instead of double-extending) does not error out:
https://github.com/majapw/react-dates-demo/pull/3/commits/d79813cdf3a8576e954a9f0dee4ad8312bea9305
I believe this is because react-with-styles (along with almost every HOC) hoists statics, but does not preserve inheritance (https://github.com/airbnb/react-with-styles/blob/master/src/withStyles.jsx#L23-L33) - I don't think that's something that an HOC could or should reliably solve.
I think the solution is to find an ergonomic way to use the inlined implementation, rather than creating an inheritance hierarchy.
Is the only real answer to this a babel plugin? I've gone my whole life without writing a babel plugin and I was really hoping to maintain that streak.
I guess this could be a PureComponent polyfill of sorts? Does that make sense?
There's really these options:
ugggghhhh. okay i'm going to revert the change and publish an 18.0.3 and then republish in 18.0.4 so that I can update our internals and we can WRITE A BABEL TRANSFORM I GUESS. :|
Most helpful comment
ugggghhhh. okay i'm going to revert the change and publish an 18.0.3 and then republish in 18.0.4 so that I can update our internals and we can WRITE A BABEL TRANSFORM I GUESS. :|