mhaagens / lazy-route

Lazy/async route loading for React Router 4 through System.import
57 stars 7 forks source link

Can't use react-hot-loader ? #5

Open vimplus opened 7 years ago

vimplus commented 7 years ago

Browser console print:

[HMR] Updated modules:
index.ca91de43.js:47980 [HMR]  - ./src/routes/User/list.js
index.ca91de43.js:47980 [HMR]  - ./src/routes async recursive ^.*\.js$
index.ca91de43.js:47980 [HMR]  - ./src/routes/index.js
index.ca91de43.js:48035 [HMR] App is up to date.

Page hasn't been updated. Excuse me, what can I do?

arvigeus commented 7 years ago

Try this:

if (module.hot) {
  require('./MyAsyncComponent');
 // Manually add any component that is loaded async
}