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
Description
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
Labels
No labels