Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hot reload isn't working - asks for a full reload #530

Closed
satyavrat opened this issue Mar 25, 2016 · 3 comments
Closed

Hot reload isn't working - asks for a full reload #530

satyavrat opened this issue Mar 25, 2016 · 3 comments

Comments

@satyavrat
Copy link

[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

@frenzzy
Copy link
Member

frenzzy commented Mar 25, 2016

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);
    });
  }
}

// ...

@gaearon
Copy link

gaearon commented Apr 18, 2016

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: gaearon/react-hot-boilerplate#61

@Pines-Cheng
Copy link

try react-hot-loader .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants