Reputation: 89
I have a problem with an App im Developping with Expo - React Native. The problem is that, having only one small value stored in AsyncStorage, its takes around 25 seconds to load. There are the details:
Expo
: Version 33
Ract Native (comes with Expo)
: 0.59.8
My stored values
: {keyOne: "ValueOne"}
This is only an example for testing, obviously in the actual app i have more values. The code i am using for testing, inside App.js
is:
async componentDidMount(){
console.log("Storing value...");
await AsyncStorage.setItem("keyOne", "valueOne");
console.log("Value stored");
var value1 = await AsyncStorage.getItem("keyOne");
console.log("Obtained value: "+value1);
}
With this code, the 25 seconds
are spend storing the item.
I'm facing this problem specifically in Samsung Phones, for example a Galaxy S7 SM-g930F
. This happens when developing and in production app.
Also, if I store more values, the first that i obtain is the one slow, the rest are very fast.
Another detail is that, if i make the same test with SecureStore, is very fast.
Can i do something to speed things up?
Some alternative to AsyncStorage?
Upvotes: 2
Views: 5195
Reputation: 1180
Make sure to do following.
Upvotes: 1