folofse / androw

Shadows in React Native for Android
97 stars 16 forks source link

when use multiple androw tag only render last androw tag image #10

Closed ydv0121 closed 5 years ago

ydv0121 commented 5 years ago

multiple images are not render at first sometime when app load.. it was working previously...is there any other packages updation affect this module?? how to resolve this?? please help

=========EDITED==========

hey @folofse i just found that if we use multiple ANDROW TAG on same page it won't load all of them..it's only load last one for example i have multiple views which hase shadow like this

data=[ 'http://pngimg.com/uploads/google/google_PNG19635.png', 'http://pngimg.com/uploads/google/google_PNG19635.png', 'http://pngimg.com/uploads/google/google_PNG19635.png', 'http://pngimg.com/uploads/google/google_PNG19635.png', 'http://pngimg.com/uploads/google/google_PNG19635.png', 'http://pngimg.com/uploads/google/google_PNG19635.png', ]

` <TouchableOpacity style={{width:'100%',backgroundColor:'#FAFAFA',padding:10,marginTop:20}}> { data.map(item=>{ console.log(item) return(

) }) } ` ` { data.map(item=>{ console.log(item) return( ) }) } ` ` { data.map(item=>{ console.log(item) return( ) }) } ` it will only render LAST ANDROW VIEW with IMAGES very first time..when i reload the page..all rendered perfectly. ![shadow1](https://user-images.githubusercontent.com/37238045/61352777-db057800-a88b-11e9-9ca6-cf2be1734cff.gif) please help help
folofse commented 5 years ago

I tested this with a regular view and I got the same error, then when I logging the image errors I recieve errors on 4 of the images, I suspect the png.com has a throttle limit so that robots not should crawl and download all its content. If you change the image to picsum it works because picsum does not have any connection limits.

const data=[ 'https://picsum.photos/50/50', 'https://picsum.photos/50/50', 'https://picsum.photos/50/50', 'https://picsum.photos/50/50', 'https://picsum.photos/50/50', 'https://picsum.photos/50/50', ];

ydv0121 commented 5 years ago

but i have get my images from my server...it won't work in my app...i just shared a example that this is happening with me...should i need to apply small size images?? to render in first time?

folofse commented 5 years ago

Ok I see, try to log the error and see if the problem is caused by the image it self.

<Image style={{height:50,width:50}} source={{uri:item}} onError={err=>console.log(err)}/>

ydv0121 commented 5 years ago

not getting any log in onError={err=>console.log(err)} i think onError not calling

folofse commented 5 years ago

Ok, I should see what might cause this, it's a bit tricky to debug when I not getting the same problem.

ydv0121 commented 5 years ago

hmm thank you for effort..thanks man... but is it fixable?

folofse commented 5 years ago

You can test to replace the Androw element with a View element, you can just replace the name of it (<Androw to <View), no need to replace the styles and other attributes, if the problem goes away we know for sure that the problem is caused by Androw, if the problem remains then its might be caused by the Image or something else entirely.

ydv0121 commented 5 years ago

ohk i did this replace <Androw to <View tag and images are showing on the load like immediately.. i didn't need to reload the page or anything..images are showing on the spot

folofse commented 5 years ago

Perfect, thank you, I will make some more tests and see if I'm able to reproduce the problem.

folofse commented 5 years ago

I have found an issue and corrected it. Please update to version 0.0.27 and see if this solves your problems.

ydv0121 commented 5 years ago

thank you so much man for quiky updates. but can't check if it's solve or not because got error after update the package Tried on two diffrent version of react native: version 1 - 0.58.4 version 2 - 0.59.9 on both of this version got this error

Screenshot 2019-07-19 at 9 43 55 AM

folofse commented 5 years ago

I downgraded the file to Android support package (v 0.0.29), but in future version of React Native 0.60.xx it will require androidX so it might be a good thing to try to migrate your app to AndroidX. Heres a guide how to migrate your app https://react-native-community.github.io/upgrade-helper/?from=0.59.8&to=0.60.0

ydv0121 commented 5 years ago

thank you...yes i will migrate project to AndriodX in future ..i am getting lots of error in Migration that's why..

i am still getting same error after upgraded package to 0.0.29

folofse commented 5 years ago

That's odd, well let's try again :) , updated the version to 0.0.30..

ydv0121 commented 5 years ago

it worked fine ..thank you @folofse amazing..thank you