Skip to content

Commit bc6dfe5

Browse files
authored
fix: HMR errors (#560)
fix: HMR errors
2 parents 3bf1031 + 68f39f6 commit bc6dfe5

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/client.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ initSocket();
130130
if (module.hot) {
131131
module.hot.accept('./routes', () => {
132132
const nextRoutes = require('./routes');
133-
hydrate(nextRoutes.__esModule ? nextRoutes.default : nextRoutes).catch(err => {
134-
console.error('Error on routes reload:', err);
135-
});
133+
hydrate(nextRoutes.__esModule ? nextRoutes.default : nextRoutes);
136134
});
137135
}
138136

src/components/RouterTrigger/RouterTrigger.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { Component } from 'react';
22
import PropTypes from 'prop-types';
33
import { withRouter, Route } from 'react-router';
4+
import { hot } from 'react-hot-loader/root';
45

56
@withRouter
67
class RouterTrigger extends Component {
@@ -91,4 +92,4 @@ class RouterTrigger extends Component {
9192
}
9293
}
9394

94-
export default RouterTrigger;
95+
export default hot(RouterTrigger);

0 commit comments

Comments
 (0)