React-starter-kit: Hot reload isn't working - asks for a full reload

Created on 25 Mar 2016  路  3Comments  路  Source: kriasoft/react-starter-kit

[HMR] connected
client.js?9105:123 [HMR] bundle rebuilding
client.js?9105:126 [HMR] bundle rebuilt in 807ms
process-update.js?c782:27 [HMR] Checking for updates on the server...
process-update.js?c782:81 [HMR] The following modules couldn't be hot updated: (Full reload needed)
This is usually because the modules which have changed (and their parents) do not know how to hot reload themselves. See http://webpack.github.io/docs/hot-module-replacement-with-webpack.html for more details.
process-update.js?c782:89 [HMR] - ./src/routes/contact/Contact.js

Most helpful comment

React Hot Loader 3 supports functional components without destroying the state.
It supersedes both React Hot Loader and React Transform, and is built on lessons learned from both.
Check it out: https://github.com/gaearon/react-hot-boilerplate/pull/61

All 3 comments

It seams babel-plugin-react-transform not working with stateless functional components yet
(see gaearon/babel-plugin-react-transform/pull/85)

But you can add simple hot reload by yourself (example)

// client.js

// ...

let HotRouter = Router;
function render(state) {
  HotRouter.dispatch(/* ... */);
}

function run() {
  // ...

  if (module.hot) {
    module.hot.accept('./routes', () => {
      HotRouter = require('./routes').default;
      render(currentState);
    });
  }
}

// ...

React Hot Loader 3 supports functional components without destroying the state.
It supersedes both React Hot Loader and React Transform, and is built on lessons learned from both.
Check it out: https://github.com/gaearon/react-hot-boilerplate/pull/61

try react-hot-loader.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nguyenbathanh picture nguyenbathanh  路  4Comments

mykhas picture mykhas  路  4Comments

Jeff-Kook picture Jeff-Kook  路  3Comments

scazzy picture scazzy  路  3Comments

artkynet picture artkynet  路  4Comments