Skip to content
This repository has been archived by the owner on Jun 12, 2020. It is now read-only.

Hot Module replacement is not working ! Chapter 1 #197

Open
rocktimsaikia opened this issue Mar 29, 2019 · 1 comment
Open

Hot Module replacement is not working ! Chapter 1 #197

rocktimsaikia opened this issue Mar 29, 2019 · 1 comment

Comments

@rocktimsaikia
Copy link

rocktimsaikia commented Mar 29, 2019

I'm currently in chapter 1(page 17) of the book where i got introduced to Hot Module Replacement which seems like a very useful tool in development stage but when i tried to apply it in my hackernews app it does not reload the page automatically on changes.What could be the problem here ?

    import React from 'react';
    import ReactDOM from 'react-dom';
    import './index.css';
    import App from './App';
    
    ReactDOM.render(, document.getElementById('root'));
    
    if (module.hot) {
    module.hot.accept();
    };
@groninge01
Copy link

groninge01 commented Apr 5, 2019

You aren't rendering your 'App'.

ReactDOM.render(<App />, document.getElementById('root'));

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

No branches or pull requests

2 participants