jobtoday / react-native-image-viewing

Tiny, purely TS, modal component for viewing images 🏙
https://exp.host/@antonkalinin/react-native-image-viewing
MIT License
890 stars 290 forks source link

Image Flicker #209

Open cloviapradeepgupta opened 7 months ago

cloviapradeepgupta commented 7 months ago

@antonKalinin @maksimko @nojimage @globchastyy @youniaogu @inspmoore @rajeshde @jzyds If we update the index of images (imageIndex) using useState images flickers please help

<View style={{flex: 1, backgroundColor: 'white'}}> <ImageView visible={showImageViewer} backgroundColor={'white'} HeaderComponent={i => { return ( <SafeAreaView style={{alignItems: 'flex-end'}}> <TouchableOpacity onPress={() => { setshowImageViewer(false); setClickedImage(0); }} style={{ marginRight: RF(10), marginTop: RF(10), padding: RF(3), backgroundColor: Colors.WHITE, borderColor: Colors.WHITE6, borderWidth: RF(1), shadowColor: Colors.VERY_LIGHT_PINK, shadowOffset: {width: 0, height: 1}, shadowRadius: 4, shadowOpacity: 0.3, borderRadius: RF(25), elevation: 8, }}

<Ionicons name={'close'} size={RF(25)} color={'black'} /> ); }} images={getImageViewerArray()} imageIndex={clickedImage} swipeToCloseEnabled={false} FooterComponent={i => { return (

index.toString()} renderItem={({item, index}) => ( setClickedImage(index)} )} />

); }} onRequestClose={() => { setshowImageViewer(false); setClickedImage(0); }} />