Registry / storage / react-native-expo-image-cache

react-native-expo-image-cache

JSON →
library4.1.0jsnpmunverified

React Native image cache and progressive loading component based on Expo. Current stable version is 4.1.0. Release cadence is irregular, with major version bumps following Expo SDK updates. Key differentiators: built on Expo File System, supports preview placeholder, transition duration, and programmatic cache management. Ships TypeScript definitions.

storage
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESM named import is correct. Default import is not supported. TypeScript types are included.

import { Image } from 'react-native-expo-image-cache'

Named import only. CacheManager is a singleton with methods get() and clearCache().

import { CacheManager } from 'react-native-expo-image-cache'

No direct export of ImageProps; infer from Image component. Available in TypeScript types.

import { Image } from 'react-native-expo-image-cache'; type MyProps = Image['props']

Shows import of Image and CacheManager, usage of Image component with preview and uri props, and async retrieval of cached file path.

import { Image, CacheManager } from 'react-native-expo-image-cache'; const preview = { uri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==' }; const uri = 'https://example.com/image.png'; export const CachedImage = () => ( <Image style={{ height: 100, width: 100 }} {...{preview, uri}} /> ); // Optional: get local path const getPath = async () => { const path = await CacheManager.get(uri).getPath(); console.log(path); };
Debug
Known footguns
breakingVersion 4.x drops support for React Native <0.60 and Expo SDK <36.
gotchaCacheManager.get(uri).getPath() returns undefined if download fails.
gotchaThe preview prop must be a local image require or a data URI, not a remote URL.
deprecatedManual cache clearance must be done with async/await.
breakingIn version 3.x, Image component required tint prop; in 4.x tint defaults to 'dark' and is optional.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
21 hits · last 30 days
gptbot
3
amazonbot
3
bytedance
3
Resources