duguyihou / react-native-turbo-image

Performant image component for React Native
https://www.npmjs.com/package/react-native-turbo-image
MIT License
165 stars 8 forks source link

Android Crash: Error While updating property 'resizeMode' of a view managed by: TurboImageView #312

Closed Gautham495 closed 2 months ago

Gautham495 commented 2 months ago

I got a crash in android stating: Error While updating property 'resizeMode' of a view managed by: TurboImageView.

<TurboImage source={require('../../Assets/IMG.webp')} style={styles.bg} resizeMode="cover" />

Above is the code sample.

duguyihou commented 2 months ago

@Gautham495

It works on my side. Can you create a example app to reproduce it?

image
Gautham495 commented 2 months ago

Actually it happened in here only where i passed a boolean value directly to the source. FastImage handled it but i think turbo cannot and I should split to 2 different components and not split the source itself. Both are remote uris.

<TurboImage source={{ uri: someBoolean ? image1 : image2, }} style={{ width: someBoolean ? screenWidth 0.1 : screenWidth 0.13, height: someBoolean ? screenWidth 0.1 : screenWidth 0.13, zIndex: 1000, borderRadius: 10, }} resizeMode="cover" />

Gautham495 commented 2 months ago

I think this might be an extreme edge case but worth mentioning in the docs if possible like the animated turbo image component.

duguyihou commented 2 months ago

okay, maybe enhance it in the future. Closing it.

Gautham495 commented 2 months ago

Yes thanks. Will keep this in mind when making future components with turbo image.