error message -
The provider does not support changing storage on the fly. Most likely, you see this error because you upgraded to Redux 2.x and React Redux 2.x, which no longer burn with reloadable reducers. See https://github.com/reactjs/react-redux/releases/tag/v2.0.0 for migration instructions.
configureStore.js -
import { createStore,applyMiddleware } from 'redux';
import ReduxThunk from 'redux-thunk';
import reducers from './reducers';
export default function configureStore(initialState) {
const store = createStore(reducers,{},applyMiddleware(ReduxThunk));
if (module.hot) {
// console.log("in module.hot");
console.log(reducers);
module.hot.accept( () => {
const nextRootReducer = require('./reducers/index').default;
store.replaceReducer(nextRootReducer)
});
}
return store;
}
App.js -
render(){
const store = configureStore();
return(
<Provider store = {store}>
<Container>
<Login/>
</Container>
</Provider>
refrence - video - https://www.youtube.com/watch?v=t2WXfAqLXJw
github - https://github.com/reactjs/react-redux/releases/tag/v2.0.0
the solution given in the video is implemented
source
share