A package to get cache size and clear caches.
yarn add react-native-caches
import Caches from 'react-native-caches'
const fetchInfo = async () => {
const info = await Caches.getCacheSize()
console.log('fetchInfo', info)
setCacheSize(info.cacheSize)
setCacheUnit(info.unit)
}
const clearCache = async () => {
await Caches.runClearCache()
await fetchInfo()
}
- Add android support
- Add ios support