folofse / androw

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

Touchable working slow #2

Closed ydv0121 closed 5 years ago

ydv0121 commented 5 years ago

hello, this is awesome library..got exactly what i want..the shadow effects on android without any glitches i just love your work

but only problem i get is when i use TouableOpacity inside the <Androw> </Androw> it's bit lag during press

here is my code

` <Androw style={Platform.OS == 'android'?styles.shadowAndroidSocialF:{width:'43%',paddingLeft:10}}>
<TouchableOpacity onPress={()=>{this._fbAuth()}} style={styles.socialButtonsFB}> <View style={{flex:1,flexDirection: 'row',left:'22%',alignItems:'center',position:'absolute',top:'22%'}}>

FACEBOOK `
folofse commented 5 years ago

hello @ydv0121

Thanks for your feedback, Im happy to hear that you like the lib and thanks to @msand it even got better and faster!

Right off the bat I suspects that it is the re-rendering of the components opacity that also causes the re-render of the shadow, that makes it a bit slow. But I should look in to it and see what might cause the problem!

ydv0121 commented 5 years ago

Thank you, have you any temporary solution about this?

and yes lib is very perfect but we have to just play with styles to get proper result.. i am getting proper accurate result like iOS shadows

folofse commented 5 years ago

In my simulator there is no delay, so I suspect something more is causing your problem. I had a similar problem in an other app I built. I used mobx and react-navigator and multiple hidden views where rendering in the background and caused the app to act slow. By adding console.log to the render-functions of your other views you can see if something more gets re-rendered on press.