-
Notifications
You must be signed in to change notification settings - Fork 196
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
HMR not working #1
Comments
Thanks for letting me know. It is indeed not working. I'll have a look. |
This is a hard to fix problem it seems... It's coming from react-router. When I remove everything that has to do with the router the hot reloading works fine. I haven't found a good solution yet, but I have managed to make the page reload when there's a change. I know it's not the same as actually hot reloading it though. Change your Root.dev.js to this: import React, { Component, PropTypes } from 'react';
import { Provider } from 'react-redux';
import routes from '../routes';
import DevTools from './DevTools';
import { Router } from 'react-router';
export default class Root extends Component {
render() {
const { store, history } = this.props;
return (
<Provider store={store}>
<div>
<Router history={history} routes={routes} />
<DevTools />
</div>
</Provider>
);
}
}
if (module.hot) {
module.hot.decline("../routes.js");
}
Root.propTypes = {
store: PropTypes.object.isRequired,
history: PropTypes.object.isRequired
}; |
I just changed from react-transform to React Hot Loader 3 and HMR is now working! It still gives the error message about the router not liking being changed though I took this as an example |
Just clone the repo, ran npm install and then npm start. HMR not working.
The text was updated successfully, but these errors were encountered: