React-native-fast-image: Detect if image is in cache

Created on 18 Sep 2018  路  6Comments  路  Source: DylanVann/react-native-fast-image

Is there any way to detect if an image is in the cache?

My use case is that I want to do a progressive image loading effect when the image is not cached (fade in on load). However, I don't want the fade when the image is cached, because it is better to just show the image immediately in that case

Most helpful comment

If you want to show up cached images immediately, and show loader on newly images, you can use a temporary hack until it will be improved:

InitialState: isLoading: false

onProgress //set isLoading to true
onLoadEnd //set isLoading to false

All 6 comments

+1 I'm currently looking for this same solution

+1 I was here for the same use case !

This will be possible once https://github.com/DylanVann/react-native-fast-image/pull/228 is implemented

Please check #351

+1 for this, I'm in the same situation :(

If you want to show up cached images immediately, and show loader on newly images, you can use a temporary hack until it will be improved:

InitialState: isLoading: false

onProgress //set isLoading to true
onLoadEnd //set isLoading to false
Was this page helpful?
0 / 5 - 0 ratings

Related issues

OmarBasem picture OmarBasem  路  3Comments

bhuvin25 picture bhuvin25  路  3Comments

taschik picture taschik  路  3Comments

Aligertor picture Aligertor  路  3Comments

baba43 picture baba43  路  3Comments