wcandillon / react-native-expo-image-cache

React Native Image Cache and Progressive Loading based on Expo
MIT License
668 stars 125 forks source link

TouchableWithoutFeedback doesn't work if I use preview. #164

Closed andrey-grach closed 3 years ago

andrey-grach commented 3 years ago

I get preview from documentation to the lib. const preview = { uri: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==" }; Image component inside TouchableWithoutFeedback:

<TouchableWithoutFeedback onPress={() => onMarkerPress(item)}>
            <Image {...{uri: item.images[0].image, preview}}
                style={{
                    backgroundColor: "floralwhite",
                    borderRadius: 5,
                    height: '60%',
                    width: width/1.4,
                }}
            />
    </TouchableWithoutFeedback>

If i remove preview it would work but now I cannot click on TochableWithoutFeedback.

andrey-grach commented 3 years ago

Okay we just need to add View between TouchableWithoutFeedback and Image :

<TouchableWithoutFeedback onPress={() => onMarkerPress(item)}>
        <View>
            <Image {...{uri: item.images[0].image, preview}}
                style={{
                    backgroundColor: "floralwhite",
                    borderRadius: 5,
                    height: '80%',
                    width: width/1.4,
                }}
            />
        </View>
    </TouchableWithoutFeedback>