By default, Beagle RN will only cache files temporally, i.e. as soon the app is closed, the cache
will be lost. To make a persistent cache, you must provide an implementation of the interface
BeagleStorage
. Both react-native/AsyncStorage
and @react-native-async-storage/async-storage
implement this interface. We don’t use React Native’s default implementation because it’s
deprecated.
If you need to persist the cache, we recommend using @react-native-async-storage/async-storage
. To
install it, follow the instructions
here.
To use it with beagle, just add the following configuration to src/beagle/beagle-service.ts
:
import AsyncStorage from '@react-native-async-storage/async-storage'
// ...
export default createBeagleUIService({
// ...
customStorage: AsyncStorage,
})
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.