We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a51ed9 commit 69947a3Copy full SHA for 69947a3
src/index.js
@@ -37,3 +37,15 @@ ReactDOM.render((
37
</Provider>
38
), document.getElementById('root')
39
);
40
+
41
42
+if (module.hot) {
43
+ module.hot.accept();
44
45
+ // fix hot module replacement for reducers
46
+ module.hot.accept('./ducks/index', () => {
47
+ const nextRootReducer = require('./ducks/index');
48
49
+ store.replaceReducer(nextRootReducer);
50
+ });
51
+}
src/redux-store.js
@@ -44,14 +44,5 @@ export default function configureStore(initialState) {
}
-
- if (module.hot) {
- module.hot.accept('./ducks/index', () => {
- const nextRootReducer = require('./ducks/index');
52
- store.replaceReducer(nextRootReducer);
53
- });
54
- }
55
56
return store;
57
0 commit comments