# React-native expo image cache deprecated

**URL:** <https://forum.codewithmosh.com/t/react-native-expo-image-cache-deprecated/15818>\
**Category:** React Native\
**Created:** [October 11, 2022, 7:15pm UTC](https://forum.codewithmosh.com/t/react-native-expo-image-cache-deprecated/15818 "2022-10-11T19:15:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cruso003](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/cruso003/32/4709_2.png) [@cruso003](https://forum.codewithmosh.com/u/cruso003)\
**Post date:** [October 11, 2022, 7:15pm UTC](https://forum.codewithmosh.com/t/react-native-expo-image-cache-deprecated/15818/1 "2022-10-11T19:15:13Z")

</div>

Hi, I am just taking the ultimate react native course and i’m on part two of the series(specifically offline support). In the course Mosh is using the alternative  
React-native expo image cache however, the library is deprecated. Any idea on the way foward?

---

<div class="post-metadata">

**Author:** ![cruso003](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/cruso003/32/4709_2.png) [@cruso003](https://forum.codewithmosh.com/u/cruso003)\
**Post date:** [October 11, 2022, 9:00pm UTC](https://forum.codewithmosh.com/t/react-native-expo-image-cache-deprecated/15818/2 "2022-10-11T21:00:07Z")

</div>

Moreover I get this error when i try using it (Android Bundling failed 2730ms  
Unable to resolve “react-native-svg” from “node\_modules\react-native-progress\Circle.js”)

i’m not using progress circle so i don’t understand why i’m getting this error.

I am trying to reinstall progress and i keep getting error

---

<div class="post-metadata">

**Author:** ![cruso003](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/cruso003/32/4709_2.png) [@cruso003](https://forum.codewithmosh.com/u/cruso003)\
**Post date:** [October 12, 2022, 10:19am UTC](https://forum.codewithmosh.com/t/react-native-expo-image-cache-deprecated/15818/3 "2022-10-12T10:19:53Z")

</div>

After struggling to debug the app all night, here’s what i found.

React-Native-Cache-Image has a serious bug, probably because it is deprecated. It broke the react native progress folder thereby causing that error above. I deleted the cached -image folder and remove all trace of the cache-image code from my project and now my project is fine. However, for some unknow reason, i cannot install react-native-progress with npm in this project only yarn. I tried installing it with npm in a new project and it work just fine, if someone got any idea why please let me know.

Lastly my project in running but i still cant complete the offline section due to image-cache being deprecated, I’m hoping @codewithmosh can look into this as the community seems quiet and outside help proving fruitless as well.

---

<div class="post-metadata">

**Author:** ![b0h](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@b0h](https://forum.codewithmosh.com/u/b0h)\
**Post date:** [October 22, 2022, 1:50am UTC](https://forum.codewithmosh.com/t/react-native-expo-image-cache-deprecated/15818/4 "2022-10-22T01:50:23Z")

</div>

you most open the terminal as administrators after that install:

> npm install react-native-progress

> expo install react-native-svg

focus on the lesson: 17- Adding a Progress Bar

---

<div class="post-metadata">

**Author:** ![cruso003](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/cruso003/32/4709_2.png) [@cruso003](https://forum.codewithmosh.com/u/cruso003)\
**Post date:** [January 5, 2023, 4:52pm UTC](https://forum.codewithmosh.com/t/react-native-expo-image-cache-deprecated/15818/5 "2023-01-05T16:52:35Z")

</div>

I dont have problem with my progress bar. I had issue with the cache image library since it is deprecated.

---

<div class="post-metadata">

**Author:** ![Kay2](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@Kay2](https://forum.codewithmosh.com/u/Kay2)\
**Post date:** [March 4, 2023, 7:58pm UTC](https://forum.codewithmosh.com/t/react-native-expo-image-cache-deprecated/15818/6 "2023-03-04T19:58:06Z")

</div>

Screenshot of the code

---

<div class="post-metadata">

**Author:** ![atakanb](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@atakanb](https://forum.codewithmosh.com/u/atakanb)\
**Post date:** [July 13, 2024, 11:59pm UTC](https://forum.codewithmosh.com/t/react-native-expo-image-cache-deprecated/15818/7 "2024-07-13T23:59:09Z")

</div>

import { Image } from “react-native-expo-image-cache”;

just a little update: [React Native Expo Image Cache](https://www.npmjs.com/package/react-native-expo-image-cache) library works in 2024.

IMPORT THE PACKAGE

```auto
import { Image } from "react-native-expo-image-cache";

```

INCLUDE THE ATTRIBUTES TO YOUR COMPONENT

```auto
function Card({
  title,
  subTitle,
  imageUrl,
  onPress,
  numberOfLines = 2,
  thumbnailUrl,
}) {
  return (
    <TouchableWithoutFeedback onPress={onPress}>
      <View style={styles.background}>
        <View style={styles.cardContainer}>
          <Image
            style={styles.image}
            tint="light"
            preview={{ uri: thumbnailUrl }}
            uri={imageUrl}
          />

```

MAKE THE CHANGES ON THE SCREEN

```auto
      <FlatList
        data={getListingsApi.data}
        keyExtractor={(listings) => listings.id.toString()}
        renderItem={({ item }) => (
          <Card
            title={item.title}
            subTitle={"$" + item.price}
            imageUrl={
              item.images && item.images.length > 0 ? item.images[0].url : null
            }
            onPress={() => navigation.navigate(routes.LISTING_DETAILS, item)}
            thumbnailUrl={
              item.images && item.images.length > 0
                ? item.images[0].thumbnailUrl
                : null
            }
          />
        )}
      />

```

---

<div class="post-metadata">

**Author:** ![delboy1978uk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/delboy1978uk/32/4513_2.png) [@delboy1978uk](https://forum.codewithmosh.com/u/delboy1978uk)\
**Post date:** [August 27, 2024, 2:41pm UTC](https://forum.codewithmosh.com/t/react-native-expo-image-cache-deprecated/15818/8 "2024-08-27T14:41:08Z")

</div>

Hi guys, the latest `expo-image` uses caching, see [Image - Expo Documentation](https://docs.expo.dev/versions/latest/sdk/image/#cachepolicy)
