From 0c5ad96649a3d9ebe0a78f5a9a34a81afe0db32f Mon Sep 17 00:00:00 2001 From: meriadec Date: Mon, 19 Mar 2018 11:53:33 +0100 Subject: [PATCH] Updated syntax for hot-reloading --- src/components/App.js | 5 ++++- src/renderer/init.js | 7 ------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/components/App.js b/src/components/App.js index 5b299d2c..41be7c6b 100644 --- a/src/components/App.js +++ b/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 ({ ) + +export default hot(module)(App) diff --git a/src/renderer/init.js b/src/renderer/init.js index 2d58b5b0..9be31456 100644 --- a/src/renderer/init.js +++ b/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() - }) -}