Browse Source

Updated syntax for hot-reloading

master
meriadec 7 years ago
parent
commit
0c5ad96649
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 5
      src/components/App.js
  2. 7
      src/renderer/init.js

5
src/components/App.js

@ -6,6 +6,7 @@ import { ConnectedRouter } from 'react-router-redux'
import { Switch, Route } from 'react-router'
import { Provider } from 'react-redux'
import { I18nextProvider } from 'react-i18next'
import { hot } from 'react-hot-loader'
import theme from 'styles/theme'
@ -17,7 +18,7 @@ import Print from 'components/layout/Print'
const { DEV_TOOLS } = process.env
export default ({
const App = ({
store,
history,
language,
@ -40,3 +41,5 @@ export default ({
</I18nextProvider>
</Provider>
)
export default hot(module)(App)

7
src/renderer/init.js

@ -59,10 +59,3 @@ async function init() {
}
init()
if (module.hot) {
module.hot.accept('../components/App', () => {
const NewApp = require('../components/App').default
r(<NewApp store={store} history={history} language={language} />)
})
}

Loading…
Cancel
Save