Closed jonaswindey closed 8 years ago
Yeah, I think it happens whenever you change something in the index.js
file. I can try to find a solution for that...
module.hot.accept('./i18n', () => {
let i18n = require('./i18n');
// do something with the new version to re-render
});
@jonaswindey I've kept now index.js
very simple so that it doesn't get easily hot reloaded, hence the warning is gone if you update for example the locales.
@gaearon thanks for the tip. I'm not sure how to use it though as it's used here and I'm not sure how should I replace it.
If I do it this way and I try to change something nothing actually re-renders although I can see in the console that it's updated...
diff --git lib/Root.js lib/Root.js
index 8d61fc3..409e56d 100644
--- lib/Root.js
+++ lib/Root.js
@@ -9,7 +9,7 @@ import configureStore from './utils/configure-store'
import * as storage from './persistence/storage'
import * as components from './components'
import * as constants from './constants'
-import * as i18n from './i18n'
+// import * as i18n from './i18n'
const {
About,
@@ -34,6 +34,11 @@ const initialState = {
export const store = configureStore(initialState)
+let i18n = require('./i18n')
+module.hot.accept('./i18n', () => {
+ i18n = require('./i18n')
+})
+
function getRootChildren (props) {
const intlData = {
locale: props.application.locale,
Can you give me an hint maybe how it needs to be done correctly? Thanks!
When you change something in the locales, you get the following error:
Although looking at the code in configure-store.js, it seems that you followed the changes correctly.