Open Florent75 opened 4 years ago
Sounds like you are hitting the default timeout (which is 5s), see https://github.com/rt2zz/redux-persist/blob/master/src/persistReducer.js#L24
Hi Holmberd,
Thanks a lot for this link, you are perfectly right. If I set the timeout to 1000, it does startup in 1000ms.
I am still wondering what timeout I shoud put, and moreover, is my redux well persisted if I set a timeout of 1ms (which seem "quite" fast) ?
Thanks
I would also like to know how we can optimize this
Do you still have the problem? @Florent75 @Hirbod
I read the code here: https://github.com/rt2zz/redux-persist/blob/master/src/persistReducer.js#L89 that if the timeout is reached the previous state could not be restored and is empty. This read error silently fails...
Hey Guys I have the 5s issue as well, unfortunately both links #L27 and #L89 are 404ing :(
Update: Found it: const persistConfig = { timeout: 1000, key: "root", storage: AsyncStorage, // stateReconciler: autoMergeLevel2, };
Hey Guys I have the 5s issue as well, unfortunately both links #L27 and #L89 are 404ing :(
Update: Found it: const persistConfig = { timeout: 1000, key: "root", storage: AsyncStorage, // stateReconciler: autoMergeLevel2, };
Thanks a lot @ArisPapaiakovou! I was having the same 5s issue. It took me a long time just to understand that the issue is coming from a default timeout setting on Persist Gate loading. This "config" workaround should be included in the docs for sure.
Hi,
Here is my context :
"redux-persist": "^5.10.0"
App.js : Provider store={Store} PersistGate persistor={persistor} ... /PersistGate /Provider
At startup, I come from a state where there is nothing stored in redux (data have been deleted)
My app is taking 5 s on cold start, Just to go from App.js to the "initialRouteName" configured in navigation.js.
If I remove :
Is it some kind of a regular behaviour ? How can I decrease this startup time ?