Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Hot reload doesn't work #50

Open
Open
@nikhil-advait

Description

@nikhil-advait

Hot reload works properly with just create-react-app but doesn't work with react-scripts-ts.

I have included following in index.tsx

if ((module as any).hot) {
  (module as any).hot.accept('./App', () => {
    const NextApp = require('./App').default;
    ReactDOM.render(<NextApp />, document.getElementById('root'));
  });
}

Since I am using create-react-app that uses webpack-2, I have tried following also:

if ((module as any).hot) {
  (module as any).hot.accept('./App', () => {
    ReactDOM.render(<App />, document.getElementById('root'));
  });
}

But still it doesn't work. CSS hot reload works btw. I also converted my App component to pure function instead of class but to no avail.

Following are the versions:
create-react-app - 1.3.3
react-scripts-ts - 2.4.0

Please help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions