Skip to content

Commit

Permalink
fix: remove cache property if using fallback
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Milan Susnjar authored and DylanVann committed Jul 17, 2020
1 parent 2eb3199 commit ba0f238
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -164,6 +166,8 @@ function FastImageBase({
)
}

const resolvedSource = Image.resolveAssetSource(source as any)

return (
<View style={[styles.imageContainer, style]} ref={forwardedRef}>
<FastImageView
Expand Down

0 comments on commit ba0f238

Please sign in to comment.