From 331c50672855e0c8a830aa59c5c2ce8b51b60f0c Mon Sep 17 00:00:00 2001
From: Eric Bailey <git@esb.lol>
Date: Tue, 15 Aug 2023 14:53:03 -0500
Subject: fix prefetching lightbox images (#1163)

* fix prefetching lightbox images

* use array signature

* fix other RN native image usage

* delay prefetching to allow UI to re-render
---
 .../com/lightbox/ImageViewing/components/ImageItem/ImageItem.ios.tsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.ios.tsx')

diff --git a/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.ios.tsx b/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.ios.tsx
index ebf0b1d28..a6b98009a 100644
--- a/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.ios.tsx
+++ b/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.ios.tsx
@@ -18,6 +18,7 @@ import {
   NativeSyntheticEvent,
   TouchableWithoutFeedback,
 } from 'react-native'
+import {Image} from 'expo-image'
 
 import useDoubleTapToZoom from '../../hooks/useDoubleTapToZoom'
 import useImageDimensions from '../../hooks/useImageDimensions'
@@ -42,6 +43,8 @@ type Props = {
   doubleTapToZoomEnabled?: boolean
 }
 
+const AnimatedImage = Animated.createAnimatedComponent(Image)
+
 const ImageItem = ({
   imageSrc,
   onZoom,
@@ -131,7 +134,7 @@ const ImageItem = ({
           accessibilityRole="image"
           accessibilityLabel={imageSrc.alt}
           accessibilityHint="">
-          <Animated.Image
+          <AnimatedImage
             source={imageSrc}
             style={imageStylesWithOpacity}
             onLoad={() => setLoaded(true)}
-- 
cgit 1.4.1

