Skip to content
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

Unexpected key offline in preloaded state #41

Closed
BlakeRxxk opened this issue Sep 28, 2017 · 3 comments
Closed

Unexpected key offline in preloaded state #41

BlakeRxxk opened this issue Sep 28, 2017 · 3 comments

Comments

@BlakeRxxk
Copy link

I've got this error with react-native app and HMR:
Unexpected key "offline" found in preloadedState argument passed to createStore. Expected to find one of the known reducer keys instead: "user". Unexpected keys will be ignored.

my configureStore.js

/* global __DEV__ */
import { applyMiddleware, createStore, compose } from 'redux';
import { offline } from '@redux-offline/redux-offline';
import offlineConfig from '@redux-offline/redux-offline/lib/defaults';

const createStoreWithMiddleware = compose(
  applyMiddleware(
    ...middlewares,
  ),
  offline({
    ...offlineConfig,
    persistOptions: {
      whitelist: ['user'],
    },
  }),
)(createStore);
const store = createStoreWithMiddleware(reducers);


if (module.hot) {
  module.hot.accept(() => {
    const nextRootReducer = require('../modules/index').default; // eslint-disable-line
    store.replaceReducer(nextRootReducer);
  });
}

export default store;

something wrong with my code or is there bug in redux-offline

@wacii
Copy link
Collaborator

wacii commented Sep 28, 2017

It's a bug with redux-offline. Issue #31 reports the same issue. This should be addressed by PR #32.

@BlakeRxxk
Copy link
Author

My bad, didn't noticed PR, i think issue could be closed as duplicate

@wacii
Copy link
Collaborator

wacii commented Oct 15, 2017

#32 has been merged so this should be fixed in the next release.

@wacii wacii closed this as completed Oct 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants