fix: remove cache property if using fallback

iOS image has its own properties for cache and if fallback
is true and regular image is being rendered we can't set
FastImage's cache value because it doesn't match.
This commit is contained in:
Milan Susnjar 2019-10-22 16:05:45 +02:00 committed by Dylan Vann
parent 2eb3199143
commit ba0f238821
1 changed files with 6 additions and 2 deletions

View File

@ -143,9 +143,11 @@ function FastImageBase({
forwardedRef,
...props
}: FastImageProps & { forwardedRef: React.Ref<any> }) {
const resolvedSource = Image.resolveAssetSource(source as any)
if (fallback) {
const cleanedSource = { ...(source as any) }
delete cleanedSource.cache
const resolvedSource = Image.resolveAssetSource(cleanedSource)
return (
<View style={[styles.imageContainer, style]} ref={forwardedRef}>
<Image
@ -164,6 +166,8 @@ function FastImageBase({
)
}
const resolvedSource = Image.resolveAssetSource(source as any)
return (
<View style={[styles.imageContainer, style]} ref={forwardedRef}>
<FastImageView