thabti / react-native-css

Style React-Native components with css
MIT License
769 stars 66 forks source link

undefined is not a function (Symbol.iterator) #60

Closed anzorb closed 7 years ago

anzorb commented 7 years ago

react-native@0.47.2 react-native-css@2.0.7 Android 7.1.1 Only happens when remote debugging is turned off. Crapping out on line 95 of build/index

 for (var _iterator = stylesheet.rules[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {

This line was transpiled from src/index at line 65:

 65 for (const rule of stylesheet.rules) {

Looks like the guys at styled components faced the same issue and removed dependency on (for of) https://github.com/styled-components/css-to-react-native/issues/31

screenshot_20170905-210413

thabti commented 7 years ago

@anzorb I'd love a PR from yourself on this. I will try to have a look at fixing this issue, however, I am traveling until tomorrow.

We shouldn't be using Symbol.

thabti commented 7 years ago

@anzorb please try react-native-css@2.1.2, both issues you raised should be working.

https://github.com/sabeurthabti/react-native-css/commit/d52ac846673c6cb515cd16822cee279f032e9ce6#diff-dfbff627e6c248bcb3b61d7d06da9ca9R105