1 | import React from 'react';
|
2 | import ReactDOM from 'react-dom';
|
3 | import { AppContainer } from 'react-hot-loader';
|
4 |
|
5 |
|
6 | // import App from './App';
|
7 |
|
8 | const App = () => {
|
9 | return <div> test App</div>;
|
10 | }
|
11 |
|
12 | const render = (Component) => {
|
13 | ReactDOM.render(
|
14 | <AppContainer>
|
15 | <Component/>
|
16 | </AppContainer>,
|
17 | document.getElementById('root')
|
18 | );
|
19 | }
|
20 |
|
21 | render(App);
|
22 |
|
23 | // Hot Module Replacement API
|
24 | if (module.hot) {
|
25 | module.hot.accept('./App', () => {
|
26 | render(App)
|
27 | });
|
28 | } |
\ | No newline at end of file |