jeanregisser / react-native-popover

A <Popover /> component for react-native
660 stars 176 forks source link

Issue with Uglify Minify #1

Closed wheycool closed 9 years ago

wheycool commented 9 years ago

Hi – nice work!

Just one problem: I can't seem to minify my app any more. Here's the error I'm getting:

Error: Error while minifying JS Transformed code line: " for(var placement of placementsToTry) {" Module name (best guess): react-native-popover/Popover Unexpected token name «of», expected punc «;» (line: 44316, col: 22, pos: 1429415)

I think it's referring to line 137 in your code: for(var placement of placementsToTry) {

Any help would be appreciated. Thanks!

wheycool commented 9 years ago

Fixed the build issue by changing "of" to "in".

However, this presents a new issue:

maximum call stack size exceed.

computeGeometry Popover.js:63

ComputeAutoGeometry Popover.js:138

jeanregisser commented 9 years ago

Thanks! I reported the issue https://github.com/facebook/react-native/issues/1499 In the meantime I'll go back to standard for loops.

Note that changing of by in it will change the behavior of the original code. That's why you have the second issue.

var fruits = ['orange', 'banana'];

for (var fruit in fruits) {
  console.log(fruit);
}
// -> output is: 0, 1

for (var fruit of fruits) {
  console.log(fruit);
}
// -> output is: 'orange', 'banana'