How To Cache Images in an Expo Managed React Native App

Written by wagslane | Published 2020/05/21
Tech Story Tags: javascript | programming | tutorial | react | react-native | open-source | expo | caching

TLDR React Native only supports caching images on IOS out of the box. CachedImage uses the same props and API as React Native's Image and ImageBackground components. It downloads the image to the user's local. filesystem using the SHA-256 hash of the image. Then, on subsequent renders and app uses, it loads the image from the. filesystem if it exists. This saves the user from using unnecessary data and experiencing slow load times. In order to bust the cache, you can append a query string or anchor text to the. URI.via the TL;DR App

no story

Written by wagslane | Founder of Boot.dev. Whining about coding sins since 2011. Committing coding sins for the same.
Published by HackerNoon on 2020/05/21