-
Notifications
You must be signed in to change notification settings - Fork 868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v5] PersistGate never renders because rehydrate never gets called #603
Comments
REHYDRATE will be called by the persisted reducer after it gets state. Some things to help debug:
|
I have the same problem. Can you look into it @rt2zz ? |
I found the issue. |
Just wanted to add here that upgrading to |
I've updated react native but still got the same problem! It works only if I call persistor.purge() on didmount, anyone knows why? |
Sometime, I do get this issue, |
Actually I have even a stranger behaviour. If I don't use persistor.purge() the component inside PersistGate call an action creator but then this component will not update e componentwillreceiveprops is not called, if I put that persistor.purge (or completely remove persistgate) it works... guys I'm going nuts with this, what could it be? @rt2zz |
I am not clear what exactly the issue is can you restate the entirety of the problem? @henrytao-me you are saying you see |
This is a really ugly issue that I had in v4 already and now I upgraded to v5 and it is still the case. Easy way to reproduce:
|
As I know, this is not a problem from |
Thank you for the info. I will try dropping Redux persist and get my items directly.
This bug makes usage a pain, especially when you use react - native auto reload function. |
@nenti There is an issue here for your reference. facebook/react-native#14101 I haven't encounter this issue (at least as often as I notice) since I use this
|
@henrytao-me I have almost the same versioning as you. From my research it is an android issue with debugger connected and for hot- and live-reloading.
It is totally annoying because ofc when you develop debugger is connected and you use reload functions. And the worst part is when you work in a team and your team does not know about this issue. |
In my case updating to the latest versions didn't help me. The app stops working at some moment, rehydrade/persist action never calls, nothing helps except killing the emulator and re-start the react-native. Is it possible to call rehydrate action without PersistGate? Or any other solutions would be good. Thanks! |
So given the issue is in the underlying storage layer, I think the only remedy redux-persist can offer is a timeout config that will set a max time for rehydration before giving up. Also I would recommend considering an alternative storage adapter, e.g. https://github.com/robwalkerco/redux-persist-filesystem-storage |
FYI we are currently contemplating adding timeout in this PR #702 That would at least give users some recourse (without the need to switch storage adapters) |
Try to define your persistor inside component constructor :
|
Switching the default redux-persist store to redux-persist-filesystem-storage fixed this issue for me! |
@ali-sao you saved with your codes. thanks |
I'm trying redux-persist for the first time, but can't get my normal render through PersistGate.
The page is blank and
loaded
is never logged.When this code runs in persistStore.js, it dispatches to reducers that are props of the
reducerConfig
that I passed topersistCombineReducers()
, butrehydrate()
is never called:Is there more I have to do that is not documented in the readme? Do I need to handle the PERSIST action myself and call rehydrate myself?
Thanks,
Matt
The text was updated successfully, but these errors were encountered: