KyleAMathews / react-spinkit

A collection of loading indicators animated with CSS for React
http://kyleamathews.github.io/react-spinkit/
MIT License
1.49k stars 73 forks source link

IE11 reports the following problem: Object doesn't support property or method 'assign' #32

Open shivshankar2020 opened 8 years ago

shivshankar2020 commented 8 years ago

Does not work IE 11 (Version: 11.0.9600.18097) . Please try loading the demo page and check the console: http://kyleamathews.github.io/react-spinkit/

Reported by console: Object doesn't support property or method 'assign'

Part of the code having the problem:

switch (this.props.spinnerName) {
          case "three-bounce":
            __webpack_require__(164);
            return React.createElement("div", Object.assign({}, this.props, {
              "className": "three-bounce " + classes
            }), React.createElement("div", {
              "className": "bounce1"
            }), React.createElement("div", {
              "className": "bounce2"
            }), React.createElement("div", {
              "className": "bounce3"
            }));
ofilipowicz commented 8 years ago

Same error here. Google Chrome.

musbaig commented 8 years ago

I believe react-spinkit is not being transpiled to es5, as a result, you'll need to use babel-polyfill (via webpack) for it to behave in IE11. babel-runtime won't help either, has to be the polyfill. I haven't seen issues with Chrome though. Just my 2¢.

KyleAMathews commented 8 years ago

React Spinkit is written in Coffeescript so kinda has to be transpiled to es5 to work :-) https://github.com/KyleAMathews/react-spinkit/blob/master/src/index.cjsx

Requiring a polyfill to use this module does seem silly though. One possible way forward would be to just convert the src to use Babel as it's the Coffee-React transformer that's adding Object.assign. Another way forward would be to add a polyfill similar to https://github.com/KyleAMathews/react-gravatar/pull/55/commits/ec5067444a2459bc9ccb6818817161c2b3e6b880.

PRs accepted :-)

ghost commented 8 years ago

Or replace with lodash.assign.

merrywhether commented 7 years ago

I think this was fixed with the ES6/Babel rewrite.