-
Notifications
You must be signed in to change notification settings - Fork 25
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
app.version
is not stored at first use
#9
Comments
Yes, just wasted 2 hours in fact because of this. I confirm this problem. |
@giordy any chance you can post your placeholder reducer for others to use? Mine (used Flow types):
and in root reducer:
Of course, my 'app version' is 'schema'. A good fix would be a custom state reconciler, or simply to require this extra reducer in the readme. |
@StevePotter this is essentially what I did. const REDUCERS = {
reducer1,
reducer2,
... // other reducers
};
// apply the fake reducer that maps migrations
REDUCERS[REDUCER_KEY] = (state={}) => state;
export default combineReducers(REDUCERS); where |
Just followed the same path myself. Would be great if someone could merge the fix from @IanVS. |
I tried adding
redux-persist-migrate
to my stack.Since it was the first time I used the lib, the
app
key was never in the initial state. As a consequence, uponpersist/REHYDRATE
reducement inredux-persist
'sdefaultStateReconciler
, theapp
key of theinboundState
(containing the version) is simply ditched out because of this line:It is easy to workaround this, for instance by adding a dummy
app
reducer, but it was not obvious to find. Since, I guess, it is a problem encountered by any new comer, shouldn't the workaround be part of the doc?The text was updated successfully, but these errors were encountered: