Skip to content

Commit

Permalink
fix: HMR errors (#560)
Browse files Browse the repository at this point in the history
fix: HMR errors
  • Loading branch information
bertho-zero authored Jul 31, 2019
2 parents 3bf1031 + 68f39f6 commit bc6dfe5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@ initSocket();
if (module.hot) {
module.hot.accept('./routes', () => {
const nextRoutes = require('./routes');
hydrate(nextRoutes.__esModule ? nextRoutes.default : nextRoutes).catch(err => {
console.error('Error on routes reload:', err);
});
hydrate(nextRoutes.__esModule ? nextRoutes.default : nextRoutes);
});
}

Expand Down
3 changes: 2 additions & 1 deletion src/components/RouterTrigger/RouterTrigger.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { withRouter, Route } from 'react-router';
import { hot } from 'react-hot-loader/root';

@withRouter
class RouterTrigger extends Component {
Expand Down Expand Up @@ -91,4 +92,4 @@ class RouterTrigger extends Component {
}
}

export default RouterTrigger;
export default hot(RouterTrigger);

0 comments on commit bc6dfe5

Please sign in to comment.