@sk39/expo-image-cache
v1.0.0
Published
Image Cache for React Native Expo
Maintainers
Readme
expo-image-cache
Image Cache for React Native Expo.

- Use react-native-expo-image-cache.
- Load only once if many components display the same image at the same time.
- Show skeleton loader while loading. Use react-native-skeleton-content.
Install
npm install @sk39/expo-image-cacheUsage
Props
| Props | Default | Description | | ------------- |:-------------:| -----:| | source | - | ImagSource | | backgroundColor | '#e9eaf8' | | | onLoaded | null | | | onError | null | |
CacheImage
import React, { Component } from 'react'
import {CacheImage} from "@sk39/expo-image-cache"
class Example extends Component {
render () {
const source = {uri: "https://picsum.photos/510/300?random"}
return (
<View style={{width: 100, height: 60}}>
<CacheImage source={source}/>
</View>
)
}
}Clear cache
import {ImageStore} from "@sk39/expo-image-cache";
await ImageStore.getInstance().clear()License
MIT © sk39
