RajuPedda
RajuPedda

Reputation: 3379

Getting error while using ReactNative + Redux-persist V 5.10

Getting error while using ReactNative + Redux-persist 5.10 - console.error: "redux-persist: rehydrate for "root" called after timeout.

Upvotes: 3

Views: 3791

Answers (4)

martom
martom

Reputation: 763

Possible causes:

1 - Emulator's date/time does not match your host OS date/time.

If that's the case, try to sync them

For example in Android you can go to(*) Settings / System / Date & Time and make sure "Use network-provided time" is enabled.

If the date/time is still incorrect you might need to disable the previous setting, then turn Android off with the power button of the emulator (do not close the emulator), and enable the setting again.

(*) it may be different dependending on the Android version

2 - redux-persist timeout is too short

You can play with different timeout values and see what happens, for example:

const persistConfig = {
  key: "root",
  storage: AsyncStorage,
  timeout: 5000 // try with different values like 1000, 3000 or 5000
}; 

Upvotes: 0

Kingsley Akpan
Kingsley Akpan

Reputation: 273

Before downgrading anything, I will recommend you close your react-native debugger and try again. react-native debugger usually causes this error.

Upvotes: 0

Aniket Rane
Aniket Rane

Reputation: 307

No need to downgrade to any version. This just when you are in debugger mode and this is mostly related to issue with setTimeout in React Native facebook/react-native#4470

Upvotes: 6

RajuPedda
RajuPedda

Reputation: 3379

Got it to work by downgrading the redux-persist version from 5.10.0 to 5.6.12.

Upvotes: 3

Related Questions