Skip to content
This repository was archived by the owner on Oct 19, 2022. It is now read-only.

Commit bf4a49f

Browse files
author
Dominik Rowicki
committed
Don't use hot-loader in the same place as ReactDOM.render
1 parent 8cc733f commit bf4a49f

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

packages/react-scripts/template/src/components/App/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { Component } from 'react';
2+
import { hot } from 'react-hot-loader';
23
import logo from './logo.svg';
34
import LogoInline from './logo.inline.svg';
45
import styles from './style.scss';
@@ -41,4 +42,5 @@ class App extends Component {
4142
}
4243
}
4344

44-
export default App;
45+
export { App as AppUnwrapped };
46+
export default hot(module)(App);

packages/react-scripts/template/src/components/App/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import App from './index';
3+
import { AppUnwrapped as App } from './index';
44

55
it('renders without crashing', () => {
66
const div = document.createElement('div');
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import { hot } from 'react-hot-loader';
43
import 'normalize.css';
54

65
import App from 'components/App';
76
import registerServiceWorker from 'utils/registerServiceWorker';
87

9-
const HotApp = hot(module)(App);
10-
11-
ReactDOM.render(<HotApp />, document.getElementById('root'));
8+
ReactDOM.render(<App />, document.getElementById('root'));
129

1310
registerServiceWorker();

0 commit comments

Comments
 (0)