React-native-image-viewer: ImageViewer does not seem to use images cached to disk, causing a slow loading

Created on 28 Feb 2019  路  4Comments  路  Source: ascoders/react-native-image-viewer

Hi @ascoders ,
I used your ImageViewer component in other apps and everything works fine, but in the last app I'm developing I'm using Firebase Storage to allow users to upload photos.

ImageViewer does not seem to use images cached to disk if I use a Firebase Storage URL. This causes a slow loading and black screen long duration when the modal is open.

So, is there a way to avoid this slowdown on the component side?

If you want, I can send you a test URL by e-mail.

Most helpful comment

Here is how I use FastImage for image caching

renderImage={(props) => (
    <FastImage
        {...props}
        style={{width: '100%', height: '100%}}
        source={{
            uri: props.source.uri,
            priority: FastImage.priority.normal,
        }}
        resizeMode={FastImage.resizeMode.contain}
    />
)}

All 4 comments

See #26 or #3

@ascoders thank you for the answer.

Can I alternatively use react-native-cached-image?

If I use cacheable-image, how to it implement using ImageViewer component? I'm confused.

Finally, why do not you use FastImage in react-native-image-zoom?

Here is how I use FastImage for image caching

renderImage={(props) => (
    <FastImage
        {...props}
        style={{width: '100%', height: '100%}}
        source={{
            uri: props.source.uri,
            priority: FastImage.priority.normal,
        }}
        resizeMode={FastImage.resizeMode.contain}
    />
)}

Here is how I use FastImage for image caching

renderImage={(props) => (
    <FastImage
        {...props}
        style={{width: '100%', height: '100%}}
        source={{
            uri: props.source.uri,
            priority: FastImage.priority.normal,
        }}
        resizeMode={FastImage.resizeMode.contain}
    />
)}

FastImage reduced the performance of my app. Things got working Ok after I uninstalled it. Please what could have caused it?

Was this page helpful?
0 / 5 - 0 ratings