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

HMR not working #1

Closed
jasan-s opened this issue Jun 21, 2016 · 3 comments
Closed

HMR not working #1

jasan-s opened this issue Jun 21, 2016 · 3 comments

Comments

@jasan-s
Copy link

jasan-s commented Jun 21, 2016

Just clone the repo, ran npm install and then npm start. HMR not working.

@jpsierens
Copy link
Owner

Thanks for letting me know. It is indeed not working. I'll have a look.

@jpsierens
Copy link
Owner

jpsierens commented Jun 22, 2016

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

#remix-run/react-router#2704

@jpsierens
Copy link
Owner

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
https://github.com/gaearon/redux-devtools/tree/master/examples/todomvc

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

2 participants