vitalets / react-native-extended-stylesheet

Extended StyleSheets for React Native
MIT License
2.93k stars 132 forks source link

media-queries.js file throws error when ran on Android #14

Closed PimDeWitte closed 7 years ago

PimDeWitte commented 8 years ago

So the library works great on iOS, but when I try to run the same library on Android, I receive the following error on startup.

screen shot 2016-06-07 at 4 58 15 pm

It's on this line: const res = Object.keys(obj).reduce((res, key) => {

I've read up on the other issues and it looks like Android is not setting these properties correctly. Can you please advise?

My code:

screen shot 2016-06-07 at 5 01 49 pm
PimDeWitte commented 8 years ago

When removing the .build() function, it works fine, except obviously the EStyleSheets don't work, but the rest of the app functions fine. Should I call it at some other location in the app?

PimDeWitte commented 8 years ago

Fixed it by adding a length check to the process(obj) function. Put this under function process(obj)

if(obj === undefined || obj.length <= 0) { return null; }

PimDeWitte commented 8 years ago

Fixed in #15. Please merge.

PimDeWitte commented 8 years ago

Reopned because issue is not fixed. I'm not sure why - but the error has returned even with the null checks.

screen shot 2016-06-08 at 10 22 36 am
vitalets commented 8 years ago

hi @PimDeWitte

could you show the object that you pass to EStyleSheet.create() ?